jQuery Validator Plugin - update custom error messages -
i'm using jquery validator plugin on form. form widget, space constraints tight. reason, don't want show normal error messages after each form field doesn't validate.
rather, each form field, have label, , inside labels of required fields, have <em>
text '(required)' in it. if user tries submit without filling out fields, add .css('color', '#f00')
<em>
s of empty fields, highlight fields need filled out. works great, far.
now need know is, event use set <em>
black if user enters data associated required field?
i change <em>
s red this, currently:
errorplacement: function(error, element) { jquery(element).prev().children('em').css('color', '#f00'); }
maybe @ using highlight/unhighlight options -- these seem designed sort of thing you're interested in. plugin calls highlight when invalid condition triggers, automatically calls unhighlight when user corrects invalid input.
you may need specify errorplacement, if prevent plugin form displaying standard error message.
Comments
Post a Comment