TextBox.applyValidCSS

Syntax

applyValidCSS();

Description

The applyValidCSS property sets style that determines highlighting of text box valid input.

Example

To execute the example, the page must contain the TextBox component named textBox (see Example of Creating the TextBox Component). Enable text box editing, set highlighting of invalid input and determine allowed characters:

// Enable text box editing
textBox.setEnableEdit(true);
// Set highlighting of invalid input
textBox.applyNotValidCSS();
// Determine allowed characters
textBox.setAllowedSymbols(['1', '2', '4', '5']);

Next manually enter the following text to the text box : 12345.

As the result, the text box is highlighted as having invalid input and contains the following text: 1245:

Apply highlighting of valid input and set forbidden input characters:

// Clear text box
textBox.setContent("");
// Apply highlighting of correctly entered value
textBox.applyValidCSS();
// Set prohibited text box characters
textBox.setRestrictedSymbols(['3', '4']);

Manually enter the following text to the text box: 12345.

After that, the text box is highlighted as having the valid input and contains the following text: 125:

See also:

TextBox