jquery validation form with ajax loaded form

前端 未结 3 1140
栀梦
栀梦 2020-12-18 07:19

I have a form with jquery validation .After submitting the form I load the same form through Ajax . My problem is jquery validation is not working for ajax loaded form . I h

3条回答
  •  执笔经年
    2020-12-18 08:09

    After you load the new form into the DOM, you need to reinitialize the validation plugin on it, since it's a different DOM element from the one that you previously loaded. You need to do this in the AJAX callback function that loads the new HTML into the DOM.

提交回复
热议问题