PHP Classes

Dependent 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  >  Locating addresses on...  >  All threads  >  Dependent Validation  >  (Un) Subscribe thread alerts  
Subject:Dependent Validation
Summary:opposite
Messages:6
Author:flavio r
Date:2012-07-09 16:04:48
Update:2012-07-14 09:46:43
 

  1. Dependent Validation   Reply   Report abuse  
Picture of flavio r flavio r - 2012-07-09 16:04:48
In the example function DependentValidation, when the field is clicked, the validation is enabled. How can I do the opposite? When the field is clicked, disable validation?

  2. Re: Dependent Validation   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2012-07-09 22:07:12 - In reply to message 1 from flavio r
There is no direct way to do that.

What you can do is to create custom input that acts like a checkbox input but inverts its logic.

Take a look at this article that explains how to implement a custom input to perform dependent validation with some logic that is associated to other inputs.

phpclasses.org/blog/package/1/post/ ...

  3. Re: Dependent Validation   Reply   Report abuse  
Picture of flavio r flavio r - 2012-07-10 06:40:18 - In reply to message 2 from Manuel Lemos
Okay Manuel.
I'm trying to create a custom_condition.

Also I am trying to change the field of example, this:

$form-> AddInput (array (
"TYPE" => "custom"
"Id" => "dependent"
'NAME' => 'dependent'
"LABEL" => "<u>D</u>ata"
"ACCESSKEY" => "D"
"CustomClass" => "form_date_class"
"Format" => "{day}/{month}/{year}"
'DependentValidation' => 'condition'
));

But he always makes the validating.

  4. Re: Dependent Validation   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2012-07-10 06:47:03 - In reply to message 3 from flavio r
Without seeing the custom input I cannot guess what is the problem.

  5. Re: Dependent Validation   Reply   Report abuse  
Picture of flavio r flavio r - 2012-07-10 13:50:38 - In reply to message 4 from Manuel Lemos
Sorry not express myself right.

I'm trying to change the field of example, test_dependent_validation.php,

$form-> AddInput (array (
'TYPE' => 'text',
'Id' => 'dependent'
'NAME' => 'dependent'
'LABEL' => '<u> D </ u> ependent'
'ACCESSKEY' => 'D',
'ValidateAsNotEmpty' => 1,
'ValidationErrorMessage' => 'It was not entered a value in the field dependent.'
'DependentValidation' => 'condition'
));

for this:

$ form-> AddInput (array (
"TYPE" => "custom"
"Id" => "dependent"
'NAME' => 'dependent'
"LABEL" => "<u>D</u>ata"
"ACCESSKEY" => "D"
"CustomClass" => "form_date_class"
"Format" => "{day}/{month}/{year}"
'DependentValidation' => 'condition'
));

I'm not using anything different, just changed the text field for a custom field.
But he always makes the validating.
Is there anything more to do to a field CustomClass = 'form_date_class'?

Look here:
200.186.208.43:88/_phplib_/FormGene ...

  6. Re: Dependent Validation   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2012-07-14 09:46:43 - In reply to message 5 from flavio r
The form_date plug-in was not forwarding the DependentValidation argument to the child inputs. That problem is fixed. You may get a fixed version from here for now. Thank you for reporting.

meta-language.net/cvs/~checkout~/fo ...