Hi there,

We managed to get the validation plugin to work with metadata inside a
class attribute, but we would like to move it to its own HTML5 data-
xxx attribute. Our current efforts look like this:

   $.metadata.setType( "attr", "data" );
   $("#commentForm").validate({meta: "data"});

with the HTML:

<input id="cname" name="name" maxlength="5" minlength="2"
required="*"
          data="{messages:{required:'Enter this!',minlength:'Too
short!'}}"/>

(we only want to put messages in there)

But this does not work. What are we doing wrong? Or, how can we tell
validate to use attr method for metadata?

(The following does work:)
<input id="cname" name="name" maxlength="5" minlength="2"
required="*"
          class="{messages:{required:'Enter this!',minlength:'Too
short!'}}"/>

Regards
- Iwan

Reply via email to