Custom Client-Side Validator Element

Getting Started | API | Elements | Actions | Validators | Handlers | About

Table of Contents

1 Custom Client-Side Validator - #js_custom {}

Attach a custom validator, written in Javascript, to an element. The validator will be executed on the client when a postback is triggered. Validation failure will prevent the postback.

See Live Validation's Validate Custom for more information about the validation function and args.

1.1 Usage

% Wire the validator against the 'my_validator' Javascript
% function, passing in some args...
wf:wire(ButtonID, TextBoxID, #validate { validators=[
  #js_custom { text="Validation failed.", function=my_validator, args="{ amount: 5 }" }
]})

1.2 Attributes

text - (string)
The text to display if validation fails.
function - (atom or string)
The name of a a Javascript function that returns true if the value is valid, false if invalid.<br>function(Value, Args) -> 'true' or 'false'
args - (JSON String)
Extra arguments passed to the custom validation function.

Author: Rusty Klophaus (@rklophaus) <>

Date: 2010-06-14 18:34:56 EDT

HTML generated by org-mode 6.33f in emacs 22