59 parent::__construct(
'');
60 $this->page->AddScript(
'm_validate.js');
76 $identifier = str_replace(
']',
'', str_replace(
'[',
'_', $this->field));
77 $identifier = str_replace(
'.',
'_', $identifier);
82var
$name =
new MIOLO_Validator();
83$name.id =
'{$this->id}';
84$name.form =
'{$this->form}';
85$name.field =
'{$this->field}';
86$name.label =
'{$this->label}';
87$name.min =
'{$this->min}';
88$name.max =
'{$this->max}';
89$name.type =
'{$this->type}';
90$name.chars =
'{$this->chars}';
91$name.mask =
'{$this->mask}';
92$name.msgerr=
'{$this->msgerr}';
94if ( !window.MIOLO_validators )
96 window.MIOLO_validators = {};
98window.MIOLO_validators.$identifier =
$name;
101 if ( $this->checker )
103 $html .=
"$name.checker = 'MIOLO_Validate_Check_{$this->checker}';";
129 parent::__construct();
130 $this->
id =
'required';
134 $this->type =
'required';
137 $this->chars =
'ALL';
165 parent::__construct();
172 $this->max = strlen(
$mask);
174 $this->chars =
'ALL';
194 parent::__construct();
202 $this->chars =
'ALL';
204 $this->checker =
'EMAIL';
231 parent::__construct();
232 $this->
id =
'password';
238 $this->chars =
'ALL';
240 $this->checker =
'PASSWORD';
267 parent::__construct();
274 $this->chars =
'0123456789-';
275 $this->mask =
'99999-999';
302 parent::__construct();
307 $this->chars =
'() 01234-56789';
308 $this->mask =
'(99) 99999-9999';
335 parent::__construct();
342 $this->chars =
':0123456789';
343 $this->mask =
'99:99';
344 $this->checker =
'TIME';
371 parent::__construct();
378 $this->chars =
'.-0123456789';
379 $this->mask =
'999.999.999-99';
380 $this->checker =
'CPF';
407 parent::__construct();
414 $this->chars =
'/.-0123456789';
415 $this->mask =
'99.999.999/9999-99';
416 $this->checker =
'CNPJ';
443 parent::__construct();
444 $this->
id =
'datedmy';
450 $this->chars =
'/0123456789';
451 $this->mask =
'99/99/9999';
452 $this->checker =
'DATEDMY';
479 parent::__construct();
480 $this->
id =
'dateymd';
486 $this->chars =
'/0123456789';
487 $this->mask =
'9999/99/99';
488 $this->checker =
'DATEYMD';
534 parent::__construct();
535 $this->
id =
'compare';
541 $this->chars =
'ALL';
543 $this->checker =
'COMPARE';
560 $html = parent::Generate();
561 $html .=
"$name.operator = '{$this->operator}';\n";
562 $html .=
"$name.value = '{$this->value}';\n";
563 $html .=
"$name.datatype = '{$this->datatype}';\n";
609 parent::__construct();
617 $this->checker =
'RANGE';
618 $this->minvalue =
$min;
619 $this->maxvalue =
$max;
621 $this->chars = $this->datatype ==
'i' || $this->datatype ==
'f' ?
'+-0123456789' :
'ALL';
623 if ( $this->datatype ==
'f' )
625 $this->chars .= $separator;
641 $html = parent::Generate();
642 $html .=
"$name.minvalue = '{$this->minvalue}';\n";
643 $html .=
"$name.maxvalue = '{$this->maxvalue}';\n";
644 $html .=
"$name.datatype = '{$this->datatype}';\n";
678 parent::__construct();
679 $this->
id =
'regexp';
685 $this->chars =
'ALL';
687 $this->checker =
'REGEXP';
701 $name = str_replace(
".",
"_", $this->name);
702 $html = parent::Generate();
703 $html .=
"$name.regexp = '{$this->regexp}';\n";
757 $this->chars =
'0123456789+-'.$separator;
784 parent::__construct();
785 $this->
id =
'datetimedmy';
791 $this->chars =
':/0123456789 ';
792 $this->mask =
'99/99/9999 99:99';
793 $this->checker =
'DATETimeDMY';
__construct($field, $label='', $type='optional', $msgerr='')
__construct($field, $label='', $type='optional', $msgerr='')
__construct($field, $label='', $type='optional', $msgerr='')
__construct($field, $label='', $operator, $value, $datatype='s', $type='optional', $msgerr='')
__construct($field, $label='', $type='optional', $msgerr='')
__construct($field, $label='', $type='optional', $msgerr='')
__construct($field, $label='', $type='optional', $msgerr='')
__construct($field, $label='', $type='optional', $msgerr='')
__construct($field, $label='', $separator='.', $precision=2, $type='optional', $msgerr='')
__construct($field, $label='', $type='optional', $msgerr='')
__construct($field, $label='', $mask, $type='ignore', $msgerr='')
__construct($field, $label='', $type='optional', $msgerr='')
__construct($field, $label='', $type='required', $msgerr='')
__construct($field, $label='', $min, $max, $datatype='s', $type='optional', $msgerr='', $separator='.')
__construct($field, $label='', $regexp='', $type='optional', $msgerr='')
__construct($field, $label='', $max=0, $msgerr='')
__construct($field, $label='', $type='optional', $msgerr='')