How to Handle more than one submit button in single form?


Posted on 16th Feb 2014 07:03 pm by admin

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

No comments posted yet

Your Answer:

Login to answer
243 Like 44 Dislike
Previous forums Next forums
Other forums

why this query can delete duplicates ?
why this query can delete duplicates ? Anybody can give me the detailed explanation ?

Tha

New to PHP and just trying to understand a little code.
I hope I'm not annoying anyone or breaking the rules but I was wondering about this bit of code righ

utl_file open error
i have file in the unix path

Path /popdev01/pop/popdevb/tfi/

File name

Upload simple problem
Really confused!! I run once and it worked, but when i tried today...it didn't work

Which par

Form errors in an array
I'm processing a form and putting the errors in an array. empty($errors) doesn't seem to do the tric

Finding digits in variable containing text, and IDing them
$romanstock = "http://www.remoteprice.com/data.asp?storeid=123&itemcode=456&typ

Sharing PHP Sessions Across Domains
I am in the process of writing a script to share a php session across various domains I have.
The

php web service error
hey guys,
I'm working on a project requires the use of web services. I've been trying a few tutor

mySQL and PHP search
Hello,
I am trying to code a project and ran into a brick wall with one of my pages. I am pretty

Problem with PHP/mySQL login code
Hello,

There is an error in my login script and I can't figure out what it is...
I believe

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash