Static instance of XHTMLValidatorImpl.
This class participates in the engine library.
A service for managing asynchronous and dependency-driven actions.
See Example Implementation for an example of implementating the script on a page. This class participates in the engine library.
This is an example of using the XHTMLFormValidator and the external ValidationPatterns.xml file to validate a form field.
<input type = "text" id = "oText" value = "my@ email.com" /> <script type = "text/javascript"> // The ValidationPatterns.xml file loads asynchronously // Refer to Demonstration #5 for an example of using a task list // to load the Application config, and have the validator automatically load the patterns file. window.onload = init; function init(){ org.cote.js.xhtml.validator.XHTMLValidator.load("ValidationPatterns.xml"); // validate oText against the "email-address pattern var bValid = org.cote.js.xhtml.validator.XHTMLValidator.validateField(oT,"email-address"); // obtain the error text for the "email-address" pattern. var sE = org.cote.js.xhtml.validator.XHTMLValidator.getValidationErrorText("email-address"); } </script>
Object API structure for storing sub structures: object_config.pointers and object_config.status.
object = object.object_config
Unique instance identifier.
String = object.object_id
The type of this object.
String = object.object_type
Version of the object class.
String = object.object_version
Object load and execution state. Follows: 0 unitialized, 1 through 3 variant, 4 ready, 5 destroyed.
int = object.ready_state
Parses the patterns from the specified XML document.
void _parsePatterns( d )
Returns true if the field value validates against the web-safe pattern.
b = getIsWebSafe( o )
b as boolean: Bit indicating whether the specified field value validated against the
Returns the unique id of the object.
i = getObjectId( )
i as String: The unique object instance id.
Returns the type of the object.
t = getObjectType( )
t as String: The type of the object instance.
Returns the version of the object.
v = getObjectVersion( )
v as String: The version of the object instance.
Returns the path to the patterns file.
p = getPatternsFilePath( )
p as String: Path to the XML file containing the validation patterns.
Returns true if the patterns were loaded, false otherwise.
b = getPatternsLoaded( )
b as boolean: Bit indicating whether the patterns were loaded.
Returns the object_config.pointers sub structure.
o = getPointers( )
o as object: The object_config.pointers substructure.
Returns the state of the object.
s = getReadyState( )
s as int: The object ready state.
Returns the object_config.status sub structure.
o = getStatus( )
o as object: The object_config.status substructure.
Returns the validation error text for the specified pattern id or based on the specified DOM Node.
s = getValidationErrorText( o )
s as String: Validation error text.
Loads the specified pattern file.
void load( p )
Returns true if the field value validates against the specified pattern, and returns true if no pattern is specified; otherwise returns false.
b = validateField( o, i )
b as boolean: Bit indicating whether the specified field value validated against the specified pattern.