Closed troyji closed 13 years ago
I just updated the pull request to include my latest addition.
I added an optional jquery plugin that wraps the validate method :-) It is built on top of the new regula functionality from issue #13.
Add the scripts:
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="regula.js"></script>
<script type="text/javascript" src="jquery.regula.js"></script>
Regula jQuery usage:
$(selector).regula('validate', [options]);
Javascript usage example:
regula.bind();
var results = $("input").regula('validate');
$.each(results, function(i, r)
{
alert(r.message);
});
I just updated the pull request to include new overloads for the bind function.
regula.bind([elements], [options]);
I also added support to the jquery plugin for bind.
$(selector).regula(); //bind selected elements
$(selector).regula('bind'); //bind selected elements
$(selector)regula(options); //bind selected elements with options
$(selector).regula('bind', options); //bind selected elements with options
Fix
https://github.com/vivin/regula/issues/13