开发者

Pressing submit, nothing happens (jQuery AJAX Forms)

Example: dev.alphenweer.nl

Whe开发者_如何学Pythonn someone clicks on a link, the form gets loaded, they fill out the form, and press a button to submit it. But when someone presses the button, nothing happends. Why is that? What is wrong with my code?

For example, click on "REQUEST API AGAIN", and then just fill SOMETHING in. Nothing happens. Why?


You need to use live. Which will result in

$('#api_reg_submit').live('click', function(){...

This happens because the button, which you set click event on, is not in DOM at start aka when its ready, but its added later. If you had the button outside and loaded only inputs it would work like you have it now. Hope it makes sense :)


There's no <form> surrounding the input elements, so they're just a random textbox and button sitting on a webpage. There's no element with an id of api_req_submit on the page either, so the click function you're trying to add has nowhere to go.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜