Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  Spam!  
Old November 16th, 2009, 07:25 AM
Registered User
 
Join Date: Nov 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to Handle more than one submit button in single form?

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

Last edited by ctatvasoft; March 5th, 2014 at 05:16 AM.. Reason: thanks in advance





Similar Threads
Thread Thread Starter Forum Replies Last Post
A single JSP page havin one submit & normal button PrincessDreamz JSP Basics 1 September 4th, 2007 07:08 AM
submit form using javascript with html:button 752004 Struts 2 November 23rd, 2006 12:39 AM
Submit button in the form sends an email in C# debjanib ASP.NET 2.0 Basics 2 July 17th, 2006 03:56 AM
radio button onClick submit form crmpicco HTML Code Clinic 1 June 14th, 2005 08:32 AM
Default (Submit) Web Form button sangata .NET Web Services 2 October 20th, 2004 02:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.