The Data Validator service applies patterns defined by Data Validator Definitions, and may be used for Virtual Forms from the Data Form service to validate against field values whose nodes may or may not exist.
Static instance of XHTMLValidatorImpl.
A service for managing asynchronous and dependency-driven actions.
See Example Implementation for an example of implementating the script on a page.
This is an example of using the validator service to validate a form field.
<input type = "text" id = "oText" value = "my@ email.com" />
<script type = "text/javascript">
var oT = document.getElementById("oText");
// validate oText against the "email-address pattern
var bValid = Hemi.data.validator.service.validateField(oT,"email-address");
// obtain the error text for the "email-address" pattern.
var sE = Hemi.data.validator.service.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
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 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.
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.
[ Hemi JavaScript Framework - Stephen W. Cote, 2002 - 2009. ]