Jet\Form_Field_Tel / Form_Field::TYPE_TEL
Represents a generic form field for entering a phone number.
The Jet\Form_Renderer_Field_Input_Common renderer is used to display the form field itself.
Default error codes
Code | Meaning of |
---|---|
Form_Field::ERROR_CODE_EMPTY | The field is marked as required and the value is not specified. |
Form_Field::ERROR_CODE_INVALID_FORMAT | The value does not correspond to the expected format. Warning! Due to the differences in the formats of phone numbers and also different expectations (to enter with the national dialling code or not?) it is necessary to define a regular expression or a validator. The field itself does not perform format checking. |
Parameters
Parameter | Type | Required | Meaning of |
---|---|---|---|
validation_regexp | string | no | Validating regular expression. |
Methods
Method | Meaning of |
---|---|
public setValidationRegexp( string $validation_regexp ) : void |
Sets a regular expression to control the data format. |
public getValidationRegexp( bool $raw=false ) : string |
Returns the set regular expression to check the data format. |