Docs For Class FERegEx

## Class FERegEx

Description

This is the RegEx FormElement which builds a text input field, and validates against the is_regex() method.

Example as it would appear in FormContent::form_init_elements():

          $this->add_element( new FERegEx("FERegEx label", false, '200px', 3, '/^pattern to match$/', 'error message when pattern does not match') );

- copyright: LGPL - See LICENCE
- author: Culley Harrelson <culley@fastmail.fm>

Located in /form/form_elements/FEText.inc (line 530)

    FormElement
       |
       --FEText
          |
          --FERegEx

Variable Summary
mixed $_error_message
mixed $_regex
Method Summary
FERegEx FERegEx (label $label, [required $required = false], [width $width = NULL], [maxlength $maxlength = NULL], regex $regex, error_message $error_message)
boolean validate (FormValidation &$_FormValidation)
Variables
mixed $_error_message (line 533)

Redefinition of:

FormElement::$_error_message
  Holds the error message text

mixed $_regex (line 532)

#### Inherited Variables

Inherited from FormElement

> FormElement::$onBlurJS
> FormElement::$onChangeJS
> FormElement::$onClickJS
> FormElement::$onFocusJS
> FormElement::$onSubmitJS
> FormElement::$_attributes
> FormElement::$_element_name
> FormElement::$_errors
> FormElement::$_form_name
> FormElement::$_has_error
> FormElement::$_has_form_on_submit
> FormElement::$_is_disabled
> FormElement::$_is_readonly
> FormElement::$_is_required
> FormElement::$_label_colon_flag
> FormElement::$_label_text
> FormElement::$_required_field_marker
> FormElement::$_slave_elements
> FormElement::$_stripslashes
> FormElement::$_style_attributes
> FormElement::$_validation_enabled
> FormElement::$_value

Methods
Constructor FERegEx (line 545)

The constructor

FERegEx FERegEx (label $label, [required $required = false], [width $width = NULL], [maxlength $maxlength = NULL], regex $regex, error_message $error_message)

- label $label: string - text label for the element
- required $required: bool- is this a required element
- width $width: int - element width in characters, pixels (px), percentage (%) or elements (em)
- maxlength $maxlength: int- maximum number of chars allowed to type in
- regex $regex: string - a valid regular expression i.e. '/[a-z]+$/i'
- error_message $error_message: string - error message for failure to match the regex

validate (line 559)

This method validates the data for this Form Element.

It validates as is_regex().

boolean validate (FormValidation &$_FormValidation)

- FormValidation &$_FormValidation: object.

Redefinition of:

FormElement::validate()
  This function performs the actual validation It is called only if the validation is required by this element

#### Inherited Methods

Inherited From FEText

> FEText::FEText()
> FEText::get_element()

Inherited From FormElement

> FormElement::FormElement()
> FormElement::build_id_name()
> FormElement::create_element_name()
> FormElement::enable_validation()
> FormElement::form_tag_onsubmit()
> FormElement::get_attribute()
> FormElement::get_confirm_element()
> FormElement::get_element()
> FormElement::get_element_name()
> FormElement::get_errors()
> FormElement::get_error_message()
> FormElement::get_form_element()
> FormElement::get_init_value()
> FormElement::get_label()
> FormElement::get_label_text()
> FormElement::get_required_symbol()
> FormElement::get_slave_elements()
> FormElement::get_tabindex()
> FormElement::get_value()
> FormElement::get_value_text()
> FormElement::has_error()
> FormElement::is_disabled()
> FormElement::is_readonly()
> FormElement::is_required()
> FormElement::javascript()
> FormElement::onBlur()
> FormElement::onChange()
> FormElement::onClick()
> FormElement::onFocus()
> FormElement::onSubmit()
> FormElement::set_attribute()
> FormElement::set_colon_flag()
> FormElement::set_data_all_slaves()
> FormElement::set_disabled()
> FormElement::set_element_name()
> FormElement::set_error_message()
> FormElement::set_form_name()
> FormElement::set_label_text()
> FormElement::set_onBlur()
> FormElement::set_onChange()
> FormElement::set_onClick()
> FormElement::set_onFocus()
> FormElement::set_onSubmit()
> FormElement::set_readonly()
> FormElement::set_required()
> FormElement::set_required_symbol()
> FormElement::set_slave_data()
> FormElement::set_slave_elements()
> FormElement::set_stripslashes()
> FormElement::set_style_attribute()
> FormElement::set_tabindex()
> FormElement::set_title()
> FormElement::set_value()
> FormElement::validate()
> FormElement::_build_element_attributes()
> FormElement::_build_javascript()
> FormElement::_do_validation()
> FormElement::_sanitize_string()

Documentation generated on Thu, 1 Sep 2005 17:05:53 -0700 by phpDocumentor 1.3.0RC3