NAME='dependent_validation_form'; $form->METHOD='POST'; $form->ACTION=''; $form->InvalidCLASS='invalid'; $form->ShowAllErrors=0; $form->debug='trigger_error'; $form->AddInput(array( 'TYPE'=>'checkbox', 'ID'=>'condition', 'NAME'=>'condition', 'CHECKED'=>1, 'LABEL'=>'Validate', 'ACCESSKEY'=>'V' )); $form->AddInput(array( 'TYPE'=>'text', 'ID'=>'dependent', 'NAME'=>'dependent', 'LABEL'=>'Dependent', 'ACCESSKEY'=>'D', 'ValidateAsNotEmpty'=>1, 'ValidationErrorMessage'=>'It was not entered a value in the dependent field.', 'DependentValidation'=>'condition' )); $form->AddInput(array( 'TYPE'=>'submit', 'VALUE'=>'Submit', 'NAME'=>'doit' )); $form->LoadInputValues($form->WasSubmitted('doit')); $verify=array(); if($form->WasSubmitted('doit')) { if(($error_message=$form->Validate($verify))=='') $doit=1; else { $doit=0; $error_message=HtmlEntities($error_message); } } else { $error_message=''; $doit=0; } if(!$doit) $form->ConnectFormToInput('dependent', 'ONLOAD', 'Focus', array()); $onload=HtmlSpecialChars($form->PageLoad()); ?>