[jQuery] [validate] combining clearing default value with validate plugin
I am quite new to jquery and in particular the excellent validate
plugin. I have the validate plugin validating my form ok (on submit
only).
However, a few textarea fields in my form have default values (just
using standard html value, not labels etc). I have found several nice
little plugins to clear the default value on focus, and put it back
again if the field is left empty etc like coolinput, toggleval etc. I
can get these working on their own too.
However, when I try to combine the 2 plugins, things don't work
properly. The default values are cleared on focus alright, but then
when I enter a new value (replacing the placeholder), the validator
fires (if necessary) as soon as I lose focus, rather than waiting for
me to click submit. Then, I need to click submit twice to get
validation to fire. This effect happens regardless of which default
value plugin I use.
Here is a bit of the code I am using (using toggleVal plugin for
default value http://toggleval.kuzemchak.net/):
$().ready(function() {
$("#field-with-default").toggleVal();
$("#myform").validate();
});
Is there a way of adding the extra form field default value
functionality I need into the Validate plugin, or is there a way of
making Validate and another plugin work together on this?
Thanks for your time,
Janine.