开发者

how to use validate plugin in loaded page?

开发者 https://www.devze.com 2023-03-21 08:31 出处:网络
I have problem with use validate plugin with my loaded page... that means I\'ve used this plugin in a normal page and it works, but when I use it in ajax loaded page(by using load()) nothing happend.

I have problem with use validate plugin with my loaded page...

that means I've used this plugin in a normal page and it works, but when I use it in ajax loaded page(by using load()) nothing happend.

I've asked this because I want to validate contact form before submit it.

(I believe that it needs something like liv开发者_JAVA技巧e() function, but I don't know how to do it with validate())

PS: after I click on submit button it refresh and go to the home page(because the website depends on jquery ajax load==>that means you surf one page with load function

please I need a solustion for this problem.

thanx...


You're probably calling validate() when loading the page (the main one not the one you load with ajax) and before the form has loaded.

Call validate() after loading the page, for example in the ajax callback:

$('#container').load('form.html', function() {
  $('#yourform').validate();
});
0

精彩评论

暂无评论...
验证码 换一张
取 消