The HTML5 standard has added several new attributes to the HTML input tag. Browsers that support HTML5 might use these attributes to perform input validation; however, it is not a requirement. Test with various browsers to determine what validation each browser enforces.
The ePortal TextBox controls (ePortal:TextBox for Web Forms presentations, ep:TextBoxCell for mobile presentations) now support additional properties that map to the new HTML5 attributes, as described in the following table:
Property Name | Type | Default Value | Description |
---|---|---|---|
Type | One of the following keywords: Text, Number, Phone, URL, Email, Password, Search, or MultiLine | Text | Represents the HTML5 input type attribute. The type attribute describes the type of input expected. Notes:
|
Max | String | Empty string | Represents the HTML5 max attribute. This only applies when Type is Number. If the value is the empty string, or Type is not Number, no max attribute is rendered. This value represents the maximum value allowed. |
Min | String | Empty String | Represents the HTML5 min attribute. This only applies when Type is Number. If the value is the empty string, or Type is not Number, no min attribute is rendered. This value represents the minimum value allowed. |
Step | String | Empty string | Represents the HTML5 step attribute. This only applies when Type is Number. If the value is the empty string, or Type is not Number, no step attribute is rendered. The step attribute is a positive value that represents the granularity that is required for a numerical value. For example, the step would be "1" for an integral type. The step would be "0.01" for a decimal value that can specify two decimal places. |
Pattern | String | Empty String | Represents the HTML5 pattern attribute. This only applies when Type is not Number and not MultiLine. If the value is the empty string, or Type is Number or MultiLine, no pattern attribute is rendered. A pattern is a regular expression in the format defined by JavaScript. The pattern describes the expected format of input. The pattern is ignored if the user does not enter a value. |
Required | Boolean | False | If true, the HTML5 attribute required is rendered, and a value must be entered; for example, the empty string is not a valid input. |
Tooltip | String | Empty string | Represents the HTML5 title attribute. The title attribute provides a short description of the expected input. This is typically used as a tooltip when the user hovers a mouse pointer over the text box. This value may also be used as part of a validation error message to provide the end user with information on the format of expected input. |
When ePortal generates a Web Forms application presentation or a Web Forms Mobile application presentation, ePortal uses the settings in the HTML templates to generate the presentation from the corresponding client message. By default, the values of the validation properties from the corresponding client message (for example, MinValue, MaxValue, StepValue, Required, Pattern, and Description) are used to supply the settings for the TextBox properties described above. Refer to the topic Runtime Error Checking for Message Fields for more information.
To disable the HTML5 validation, you update the ePortal HTML templates for the TextBox controls to disable the generation of markup with the HTML5 validation attributes. Refer to the topic Changing Presentation Generation Options for more information. In particular, set the property IncludeValidationAttributes to False in the HTML template for TextBox. Refer to Markup Template Editor for more information