| Author |
how to restrict form submit
|
sreenivas jeenor
Ranch Hand
Joined: Jan 09, 2005
Posts: 125
|
|
Hi ranchers, i have delete link in the page,when its clicked it ask's for confirmation.when i click on cancel button,then the page is submitted and the value is deleted.how to restrict form submit when clicked on cancel button here is code in the jsp page ---------------------------------- <script type="text/JavaScript"> function callDelete(){ if((confirm("Do you really want to delete this complaint ?")==false)){ return false; } </script> } <html:form method="post" action="/complaintAction"> . . . <html:link action="/complaintAction?methodType=deleteComplaints" paramId="complaintId" paramName="CComplaint" paramProperty="complaintId" onKlick="callDelete()">Delete </html:link></div></td> </html:form> ------------------------- help me out... Thanks
|
 |
Herman Schelti
Ranch Hand
Joined: Jul 17, 2006
Posts: 387
|
|
hi sreenivas, there's an error in your Javascript. </script> } should be } </script> Herman PS thanks to Firefox + webdeveloper plugin.
|
 |
sreenivas jeenor
Ranch Hand
Joined: Jan 09, 2005
Posts: 125
|
|
Hi Herman, now i changed the code to this, the same problem is repeated.i am unable to restrict the form submit <script type="text/JavaScript"> function callDelete(){ if((confirm("Do you really want to delete this complaint ?")==false)){ return false; } } </script>
|
 |
Herman Schelti
Ranch Hand
Joined: Jul 17, 2006
Posts: 387
|
|
add return to your event-handler: Herman
|
 |
sreenivas jeenor
Ranch Hand
Joined: Jan 09, 2005
Posts: 125
|
|
Thanks Herman, its working now.
|
 |
 |
|
|
subject: how to restrict form submit
|
|
|