Ali Ali - 1 year ago 84
jQuery Question

MVC 4 client side validation not working for the form which is loaded using Ajax

I have an Admin page in which the user clicks on links and the corresponding

, containing a web form is then loaded inside a particular div on the Admin page using Ajax.

All of the


are referenced within the Admin page and when the
is loaded, the jQuery client side validation won't work.

but when I reference those scripts within the
, everything works just fine but I don't intend to do this for each
because they are numerous and each time each one loads, at least two of those .js files must be requested from the server again.

Is there any way I can have those scripts inside my parent (Admin) page without this issue ?

Answer Source

You need this on each one of your partial views:

$(document).ready(function () {



Basically the validation is not bound on the dynamically rendered form...

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download