I want to fire a common event whenever a value of any element in form changes. On the basis of values of form elements i want implement code.
i am writing below code but onchange event is not working on formid.
$("#formid").change(function () {
//code
});
or this
$("#formid").bind("change", function () {
//code
});
How to fire event on form whenever there is any change in element's value ?
You can bind change event for all necessary form controls
});
put this in document.ready...
Loop through all elements of your document or form and set their onChange event to your handling function. Like:
Just do as it looks like you've done. Bind the
change
event to theform
element.So long as you're not interfering with the propagation of the events, this will work.