Wijmo UI for the Web
validateText Method
wijmo.input Namespace > IFormatValidateLib Interface : validateText Method
The string value to validate as text.
The formatting string to use in validating the value.
For the full list of supported format keywords, see Text Format Keywords.
The minumum number of characters to accept as valid input.
The maximum number of characters to accept as valid input.

Use this method to validate the specified value against the specified options and return a Boolean value. If the value cannot be parsed with the specified parameters, it returns false. To use this method, instead of wijmo.input.IFormatValidateLib.validateText, use $.wijinputcore.validateText. See example below for the correct usage.

Syntax
var instance; // Type: wijmo.input.IFormatValidateLib;
var returnValue; // Type: bool

// Parameters
var value; // Type:  string
var format; // Type:  any
var minLength; // Type:  any
var maxLength; // Type:  any

returnValue = instance.validateText(value, format, minLength, maxLength);
function validateText( 
   value : string,
   format : any,
   minLength : any,
   maxLength : any
) : bool;

Parameters

value
The string value to validate as text.
format
The formatting string to use in validating the value.
For the full list of supported format keywords, see Text Format Keywords.
minLength
The minumum number of characters to accept as valid input.
maxLength
The maximum number of characters to accept as valid input.

Return Value

Returns a bool indicating whether the string value is within the specified length or in the specified format.
Example
$.wijinputcore.validateText("123", "9");   // returns: true
$.wijinputcore.validateText("あ山9", "Z");   // returns: true
$.wijinputcore.validateText("9999999", 4, 7);  //  returns: true
See Also

Reference

IFormatValidateLib Interface

Concepts

Validation Function Library
Text Format Keywords