I'm using http://jqueryvalidation.org/ plugin.
It validate on key up but no on change. For example:
<input type="text" id="test1" value="" name="test1">
<input type="checkbox" id="test2" name="test2" value="1">
jQuery('#test2').change(function() {
jQuery('#test1').val('Test1'); });
if I'm validating, validate error at #test1 shows, but when i click checkbox, it's not hidding.
I can do it in this way:
jQuery('#test2').change(function() {
jQuery('#test1').val('Test1');
jQuery('#test1').valid(); });
it works, but how to implement onchange method in validation plugin, for automatic, every field onchange validation? Not only onkeyup, but also onchange?
Start using 'input' event instead of 'change'.
jQuery('#test2').on('input', function() {
// do your stuff
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With