PHP Classes

cancel form processing

Recommend this page to a friend!

      PHP Forms Class with HTML Generator and JavaScript Validation  >  PHP Forms Class with HTML Generator and JavaScript Validation package blog  >  How to Show Google Ma...  >  All threads  >  cancel form processing  >  (Un) Subscribe thread alerts  
Subject:cancel form processing
Summary:I Want a Cancel button which stops the form being validated.
Messages:2
Author:Brian Read
Date:2007-07-12 09:26:22
Update:2007-07-12 13:44:34
 

  1. cancel form processing   Reply   Report abuse  
Picture of Brian Read Brian Read - 2007-07-12 09:26:22
I am trying to add a button to my form which abandons the processing and return the user to an earlier form, I am using this:


<form method = "Link" Action = "control_panel.php">
<input name="cancel" type="submit" dir="ltr" lang="en" value="Cancel" xml:lang="en" />
</form>

where "control_panel.php" is an earlier form.

It correctly sidesteps the writing to the database, but still applies the validation rules, which means an "empty" form cannot be abandoned until the formatting rules are conformed.

I presume it is the "local" javascript which is invoked.

cheers

Brian

PS thanks for the "premium" mode - it makes the site much more useuable.

  2. Re: cancel form processing   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2007-07-12 13:44:34 - In reply to message 1 from Brian Read
You can use the SubForm parameter to the AddInput call for the cancel submit button. Set it to "cancel" for instance. That way, when the user hits the cancel button, only other parameters with the same SubForm parameter will be validated. Just do not set any other inputs with the same SubForm parameter.