public function get_js_validation()
 {
     return 'equalityFormFieldValidator(' . TextHelper::to_js_string($this->first_field->get_id()) . ', ' . TextHelper::to_js_string($this->second_field->get_id()) . ', ' . TextHelper::to_js_string($this->get_validation_error_message()) . ')';
 }
 public function get_js_validation(FormField $field)
 {
     return 'UserExistValidator(' . TextHelper::to_js_string($field->get_id()) . ', ' . $this->error_message . ')';
 }
    private function warning_if_not_equals(FormField $field, $message)
    {
        $tpl = new StringTemplate('var field = $FF(${escapejs(ID)});
var value = ${escapejs(VALUE)};
if (field.getValue()!=value && !confirm(${escapejs(MESSAGE)})){field.setValue(value);}');
        $tpl->put('ID', $field->get_id());
        $tpl->put('VALUE', $field->get_value());
        $tpl->put('MESSAGE', $message);
        return $tpl->render();
    }
    public function get_js_validation(FormField $field)
    {
        return 'integerMaxFormFieldValidator(' . TextHelper::to_js_string($field->get_id()) . ', 
		' . (int) $this->upper_bound . ', ' . TextHelper::to_js_string($this->error_message) . ')';
    }
 public function get_js_validation(FormField $field)
 {
     return 'lengthIntervalFormFieldValidator(' . TextHelper::to_js_string($field->get_id()) . ', ' . $this->lower_bound . ', ' . $this->upper_bound . ', ' . TextHelper::to_js_string($this->error_message) . ')';
 }
 public function get_js_validation(FormField $field)
 {
     return 'regexFormFieldValidator(' . TextHelper::to_js_string($field->get_id()) . ', ' . $this->js_regex . ', ' . $this->js_options . ', ' . TextHelper::to_js_string($this->error_message) . ')';
 }
 public function get_js_validation(FormField $field)
 {
     return 'notEmptyFormFieldValidator(' . TextHelper::to_js_string($field->get_id()) . ', ' . TextHelper::to_js_string(StringVars::replace_vars($this->error_message, array('name' => strtolower($field->get_label())))) . ')';
 }