TextBox.ValidState

Syntax

ValidState: Boolean

Description

The ValidState property determines text box state as valid or invalid, setting appropriate highlighting.

Comments

Use the setValidState method to set the property value, and the getValidState method to get the property value. Property value cannot be set from JSON.

If the property is set to True, the text box is highlighted as valid, otherwise highlighting indicates invalid input.

Default value is True.

Example

To execute the example, the page must contain the TextBox component named textBox (see Example of Creating the TextBox Component). Highlight the text box as having invalid input, get and show values of background image height, width and margins:

// Set highlighting of the value invalid input
textBox.setValidState(false);
// Get value of the background image height
console.log("Background image height: " + textBox.getImageHeight());
// Get value of the background image margins
console.log("Background image margins: " + textBox.getImageMargin());
// Get value of the background image width
console.log("Background image width: " + textBox.getImageWidth());

After executing the example the text box highlighting indicates invalid input:

Also the browser console shows width, height and margin values for text box background image:

Background image height: 16

Background image margins: 2

Background image width: 10

See also:

TextBox