For that to work you need to load the metadata plugin and have it
configured to use the validate-attribute for metadata. Can't that in
your code anywhere.

See http://jquery.bassistance.de/validate/demo/radio-checkbox-select-demo.html
for an example:
$.metadata.setType("attr", "validate");

Jörn

On Mon, Feb 9, 2009 at 5:24 PM, Raymond Camden <rcam...@gmail.com> wrote:
>
> I'm trying to work up a demo of a custom validation rule that uses
> metadata only. I've cobbled the following together but the custom rule
> never fires:
>
> <script>
> $(document).ready(function(){
> jQuery.validator.addMethod("range_exp", function(value, element,
> params) {
>    return this.optional(element) || ( (value >= params[0] && value <=
> params[1]) || value == params[2] );
> }, "Please enter between {0} and {1} or {2}");
>    $("#commentForm").validate();
> });
> </script>
>
> <input id="WBC_I" type="text" size="6" validate="range_exp:[ 1,
> 999,'ND' ]" value="" name="WBC_I"/>
>
> Obviously I've stripped a bit out, but what am I missing here?
>

Reply via email to