Definition at line 278 of file validation.inc.
◆ RequiredIfCheckedValidator()
RequiredIfCheckedValidator::RequiredIfCheckedValidator |
( |
|
$field, |
|
|
|
$checkbox, |
|
|
|
$title, |
|
|
|
$checkboxTitle, |
|
|
|
$message = "" |
|
) |
| |
Definition at line 283 of file validation.inc.
288 $this->message =
$message ?
$message :
"{$title} is a required field. Please supply a value or uncheck {$checkboxTitle}.";
290 trace(
"RequiredIfCheckedValidator($field,$title,$checkboxTitle, $message)", 4);
AbstractValidator($field, $title)
trace($msg, $lvl=3, $callStack=null)
Send output to the trace log.
◆ validate()
RequiredIfCheckedValidator::validate |
( |
| ) |
|
Reimplemented from AbstractValidator.
Definition at line 310 of file validation.inc.
313 if ($this->readOnly)
return "";
315 if (!isset($_POST[$this->field]) && isset($_POST[$this->checkbox]))
◆ writeClient()
RequiredIfCheckedValidator::writeClient |
( |
| ) |
|
Reimplemented from AbstractValidator.
Definition at line 293 of file validation.inc.
295 if ($this->readOnly)
return "";
297 $msg =
jsSafe($this->message,
true);
298 $script = <<<ENDSCRIPT
300 if (form[
"{$this->field}"].style.display !=
"none" && form[
"{$this->checkbox}"].checked && form[
"{$this->field}"].value ==
"{$this->empty}")
jsSafe($str, $escapeEntities=false)
Utility function to escape a string correctly for use in a Javascript client-side call.
◆ $checkbox
RequiredIfCheckedValidator::$checkbox |
◆ $message
RequiredIfCheckedValidator::$message |
The documentation for this class was generated from the following file: