Skip to content
This repository has been archived by the owner on Nov 30, 2018. It is now read-only.

Documentation of 'validate' subscriber was corrected and has been added the example of validate subscriber #20

Merged
merged 1 commit into from Aug 24, 2011
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
45 changes: 42 additions & 3 deletions src/dform.extensions.js
Expand Up @@ -550,10 +550,49 @@
* subscriber: validate
*
* Adds support for the jQuery validation rulesets.
* For types: <text>, <password>, <textarea>, <radio>, <checkbox> sets up rules through rules("add", rules) for validation plugin
* For type <form> sets up as options object for validate method of validation plugin
* For rules of types <checkboxes> and <radiobuttons> you should use this subscriber for type <form> (to see example below)
*
* Parameters:
* options - Options as specified in the rules parameter
* type - The type of the *this* element
* Example:
* validations for radiobuttons group and for text field:
*
* (start code)
* {
* "type" : "form",
* "validate" :
* {
* "rules" :
* {
* "radio_group": "required"
* }
* },
* "elements" :
* [
* {
* "type" : "radiobuttons",
* "caption" : "You should choose from here"
* "name" : "radio_group",
* "options" :
* {
* "Y" : "Yes",
* "N" : "No"
* }
*
* },
* {
* "type" : "text",
* "name" : "url",
* "validate" :
* {
* "required" : true,
* "url" : true
* }
* }
*
* ]
* }
* (end)
*/
"validate" : function(options, type)
{
Expand Down