Re: Form Validation:
http://xataface.com/documentation/tutor ... validation
This document indicates both client-side (javascript) and server-side validation are available. However, I can't seem to figure out how to initiate client-side. For example, how would I enforce a maxlength on a field at the time of entry rather than waiting until the form is submitted?
Here is how it would be done according to the QuickForm docs:
By default, the validation rules check submitted data once it has been sent to the server. You can also enable client-side validation for some rules. To have a rule checked by the browser, before the data is submitted, add client as a fifth argument to addRule(). For example, to make sure a value is entered in the subject field that is at least five characters long, you’d use this:
// subject is required and must be at least 5 characters
$form->addRule('subject','Enter a valid subject','required',null,'client'); $form->addRule('subject','Enter a valid subject','minlength',5,'client');
The client-side validation is accomplished by JavaScript functions added to the form by HTML_QuickForm. When a user clicks the form’s submit button, the JavaScript functions run the client-side validation rules and pop up an alert box if any of the rules are not satisfied. Client-side validation is available for all of the built-in rules except for uploadedfile, maxfilesize, mimetype, and filename. It is also available for any custom regex rules. You can enable client-side validation on custom function rules if you also define a JavaScript function in the page with the same name as the custom function. That JavaScript function must duplicate the checks that the server-side PHP validation function does.