Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

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

Merged
merged 1 commit into from almost 3 years ago

2 participants

Perlover David Luecke
Perlover

Please if you will approve this commit please to recompile docs by Natural Docs and to minimize script

Perlover Perlover Documentation of 'validate' subscriber was corrected and added the ex…
…ample. To be needed a recompilation of docs and minimization of javascript for complete version
dec8e31
Perlover

I didn't test this docs (need recompiling by Natural Docs - i don't have it)
And to be needed the minimization of plugin for complete feature

David Luecke
Owner

Sure, i will merge the udpated docs. I am actually in the process of migrating from NaturalDocs to DocumentJS for the documentation and StealJS for building the plugin. With some nice JSFiddle example in the docs, it should also improve usability.

David Luecke daffl merged commit 7c6db53 into from
David Luecke daffl closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Aug 24, 2011
Perlover Perlover Documentation of 'validate' subscriber was corrected and added the ex…
…ample. To be needed a recompilation of docs and minimization of javascript for complete version
dec8e31
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 42 additions and 3 deletions. Show diff stats Hide diff stats

  1. +42 3 src/dform.extensions.js
45 src/dform.extensions.js
@@ -550,10 +550,49 @@
550 550 * subscriber: validate
551 551 *
552 552 * Adds support for the jQuery validation rulesets.
  553 + * For types: <text>, <password>, <textarea>, <radio>, <checkbox> sets up rules through rules("add", rules) for validation plugin
  554 + * For type <form> sets up as options object for validate method of validation plugin
  555 + * For rules of types <checkboxes> and <radiobuttons> you should use this subscriber for type <form> (to see example below)
553 556 *
554   - * Parameters:
555   - * options - Options as specified in the rules parameter
556   - * type - The type of the *this* element
  557 + * Example:
  558 + * validations for radiobuttons group and for text field:
  559 + *
  560 + * (start code)
  561 + * {
  562 + * "type" : "form",
  563 + * "validate" :
  564 + * {
  565 + * "rules" :
  566 + * {
  567 + * "radio_group": "required"
  568 + * }
  569 + * },
  570 + * "elements" :
  571 + * [
  572 + * {
  573 + * "type" : "radiobuttons",
  574 + * "caption" : "You should choose from here"
  575 + * "name" : "radio_group",
  576 + * "options" :
  577 + * {
  578 + * "Y" : "Yes",
  579 + * "N" : "No"
  580 + * }
  581 + *
  582 + * },
  583 + * {
  584 + * "type" : "text",
  585 + * "name" : "url",
  586 + * "validate" :
  587 + * {
  588 + * "required" : true,
  589 + * "url" : true
  590 + * }
  591 + * }
  592 + *
  593 + * ]
  594 + * }
  595 + * (end)
557 596 */
558 597 "validate" : function(options, type)
559 598 {

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.