Custom Functions

_addEvent(string object, string event, string command, [boolean append])
The _addEvent function will dynamically attach the specified command to the requested event for the specified object.

The object argument should be a string containing the valid path to a form object that the event should be attached to.

The event argument is the name of the event to attach the command to. This is a required parameter.

The command argument is JavaScript code to attach to the event.

The append argument is an optional argument that accepts either the value true or false. If true, then the command will be attached to the end of any existing instructions already in the specified event. If false, then the event will be attached in front of any other instructions. The default value is true.

_addValidator(string name, object/string function)
The _addValidator function will dynamically initialize a new validation routine. When a new validator is created, two new methods are created: a validateXXXX() and an isXXXX() method (where XXXX is equal to the name argument.) The "validate" methods are used to initialize validation on the form. These type of methods return no value. The "is" methods will return true if no error occurred, or false if an error did occur.

The name argument is the base name of the new validation procedure. This is a required parameter.

The function argument is either a pointer to an existing function, or a string to which will be converted into the new method.

_setContainerValues(string object)
The _setContainerValues function will loop through all the fields in a qForm object and find all the select boxes, which are containers. When it finds match, it'll make sure each item in the select box is selected. This will ensure that the value received by the server matches that of the getValue() for the field. This function is automatically called right before the form is submitted to the server.

The object argument is required and should contain a valid qForm's object.

[< Back] [Index] [Next >]