views:

133

answers:

1

Hi guys, I have it's a trivial problem but I can't figure it out. I'm using jquery validation plugin http://docs.jquery.com/Plugins/Validation. I have a simple form with some required field. When I submit it, it display all the possible errors beside the input field, and when I type something in the that input, the validator let disappear the plugin-generated error field. But I want a different behaviour . I want the "required" message to be present from the start beside all the required field, and let disappear it when something is typed. I hope I have been clear. Thanks in advance

Francesco,

Italy

A: 

You can initiate the validators by using $("#myform").valid();

Use onkeyup to validate as something is typed.

//setup validators
$("#myform").validate({
  onkeyup: true,
  onclick: true
  //all your other options
});

//initialize validators
$("#myform").valid();
mr.moses
Thank you, very much, it works. The method you suggeste valid() is poor documented, I read it again and again, but there were so few examples. Don't you think?
francesco