PHP Classes

RE: Conditional Validation

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  >  RE: Conditional Validation  >  (Un) Subscribe thread alerts  
Subject:RE: Conditional Validation
Summary:Hi,
Messages:2
Author:Konrad
Date:2007-05-17 15:10:58
Update:2007-05-17 16:32:59
 

  1. RE: Conditional Validation   Reply   Report abuse  
Picture of Konrad Konrad - 2007-05-17 15:10:58
I would like to know how I can make the validation on email or URL happen ONLY when the actual value is present in the field.

Thanks.


$form->AddInput(array(
"TYPE"=>"text",
"NAME"=>"fld_email",
"ID"=>"email",
"SIZE"=>34,
"MAXLENGTH"=>100,
"Capitalization"=>"lowercase",

"ValidateAsEmail"=>1,
"ValidationErrorMessage"=>"It was not specified a valid e-mail address.",
"LABEL"=>"<u>E</u>-mail address",
"ACCESSKEY"=>"E"
));

  2. Re: RE: Conditional Validation   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2007-05-17 16:32:59 - In reply to message 1 from Konrad
Set the ValidateOptional value parameter to "". See the credit_card_number field definition in the test_form.php example script.