A child tag, used in conjunction with the <input> tag. This child tag is used to validate the input of text boxes. You can choose to only accept numeric input, date input, or input with a specific format as defined by a regular expression pattern.
type |
(Required) Specifies the kind of validation that should occur. The possible values for this attribute are:
NOTE: The user must enter a value in order for it to be validated. This allows you to keep the field optional, but still validate the input if something is entered. If you want to always validate the field, you should also set the "required" attribute of the <input> tag to true. (new to version 1.2) |
expression |
(Required if type="regexp") This attribute is used if the validation type is "regexp". It contains the regular expression pattern that the user's input must match in order to be valid. This attribute is required if the type is "regexp". It is ignored if it is another type. (new to version 1.2) |
enableclientscript |
Optional. This option is valid only for regular
expression validation (as numeric and date validation isn't performed
on the client-side). Set this attribute to false to force XMod to perform the validation on the server,
rather than the client. By default, this value is true. |
message |
(Required) This is the error message that will be displayed if the user's input is invalid. (new to version 1.2) |
text |
(Optional) When using a <validationsummary>
control, you can use this property to display different text to the user
near the offending field and the <validationsummary> will use the value of the message property. A typical use would be to set this property
to an asterisk (*) and set message to the full error message. The asterisk would give
the user a visual cue that the field has an error. |
class |
(Optional) The CSS Class to be used to style the error message. (new to version 1.2) |
controltovalidate |
(Optional) For custom HTML layout forms only, this property allows you
to place your validation control wherever you'd like in your form. Normally
<validate> tags are placed inside the tag of the control they are
validating. At run-time, the validation messages are rendered next to
or below the control. With this new property you can move your validation
message elsewhere in the form to make it more visible or to fit better
with your layout. |
controltocompare |
For compare validation only:
Specify the ID (i.e. the ref)
of the control against whose value you want to compare. |
valuetocompare |
For compare validation only:
A hard-coded value to use as the basis for comparison. |
operator |
For compare validation only: Sets the comparison that will be performed. In the descriptions below, "A" is the value in the control to be validated. "B" is the value that is hard-coded in valuetocompare or the value of the control identified in controltocompare.
(new to version 4.7) |
datatype |
For compare validation only: Sets the data type the values being compared are converted to before the comparison is made. Also see the operator attribute's DataTypeCheck value. Valid values are:
(new to version 4.7) |
<input ref="txtQuantity" class="NormalTextBox" width="50px">
<label>Quantity: </label>
<default>1</default>
<validate type="numeric" message="You must enter a number for Quantity" class="NormalRed"/>
</input>