|
|
| |
1. Dependent Validation |
|
Reply |
|
|
 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 |
|
|
 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.
http://www.phpclasses.org/blog/package/1/post/8-Validating-P ... |
| |
3. Re: Dependent Validation |
|
Reply |
|
|
 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 |
|
|
 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 |
|
|
 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:
http://200.186.208.43:88/_phplib_/FormGeneration/test_depend ... |
| |
6. Re: Dependent Validation |
|
Reply |
|
|
|