Hi I have one PHP file which contains one Form. In this form there are two Submit type Buttons <input type="submit" name="edit" value="save"> <input type="submit" name="cancel" value="cancel"> <form name="myform" onsubmit="return validate()"> My problem is : When i m trying to use Javascript onsubmit event of a form it confused due to two submit buttons and onsubmit of any button(save or cancel) it runs Javascript. Generally it should not run on cancel button. Please provide solution as soon as possible. thanks in advance. Anish Panchal www.tatvasoft.com www.sparsh-technologies.com
Make the second button normal and write javscript redirection code on onclick event to redirect on another page. see example below. <input type="submit" name="edit" value="save"> <input type="button" name="cancel" value="cancel" onclick="javascript:window.location='http://redirectedurl.com'"> This should solve your issue.
Oh, It's working! thanks for the solution. Anish Panchal www.tatvasoft.com www.sparsh-technologies.com