I have a form with input elements. There are four elements in the form which are required. When i submit the form without it's selection, required error appears which is good. I fill these input fields by jquery on the selection of drop-down value. Now the problem is -> Suppose i submit the form without filling the input fields, the required validation error appears, now if i select the dropdown value and one of input fields auto populated as below:
//Drop down change event
//Fill my field
$("#inputField1").val("autoPopulate"); //textbox fill with text "autoPopulate"
By default, client side validation (
jquery.validate.js) is triggered by the
blur() event (or
.keyup()) and just updating the value of a control using jquery does not trigger any events.
You can specifically trigger the event, for example
or you can call the
.valid() method on the form after updating the values