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

PayPal Redirect Issue
When I have my paypal button set so that is redirects to http://empiremarketing.ca/order.php,it work

animation progress while uploading files?
Hello, i have some website form to upload few files to server. i want to put some gif animation whi

Create multiple (n) arrays
Hi there,

I have the following need:

I have 2 arrays (coming from a databases)

my login script page is not working on remote computers
hi my login is working on my computer, but when i tried 2 computers from 2 different locations, they

php call servlet
I have done a php backup application .
So there is a form that user pick some files to zip and d

Two warning messages
Quote<b>Warning</b>: mysql_real_escape_string() expects parameter 1 to

Warehouse Management
Hi,

On our system, we have two storage locations ( A and B ) where A is the main factory

no idea what to do...
I'm fed up. I had issues with code that I have working on a different site that didn't work on my cu

Unidentified index error in a simple form
I have been trying to make an HTML form that is handled by a PHP script. So far my attempts to get i

Help with search.php
Hello All

I need the search engine on a site I am building at the moment to display the searc

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