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

images aren't rendering
I'm trying to call a JPG file from within PHP (in an effort to hide the actual JPG folder). The imag

Multi language - seo links
Im trying to figure out the best method to have a multi language website that will function with seo

Looking for help on using joining mysql tables and php....
Does anyone have any good links to references on how to pull mysql data, through joining tables and

Simple AND question
Hello,

I've got following code:

Code: if(strpos($row[13],"http://")

How would I do "Users not logged in since *** delete them"
I know how I would set this up, and delete the user roughly.
I'll create a table called "Use

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

Error in SQL Syntax HELP!!!
I have this page:

Code: <?php

session_start();

//connect to server and s

Warning: session_start() [function.session-start]: Cann.....
hi, can someone help me with this? I keep getting this error....

Warning: session_start() [fu

The control with ID 'ace' requires a ScriptManager on the page
I'm trying to add a simple AlwaysVisibleControlExtender to my page, but it's not working. I get the

use an array from 1 class in a second class
I have a class that adds data to an array

Then I have a second class and I need to check if t

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