Hi,
I saw this topic on jQuery docs once before, but didnt read it properly, now im having the same problem and cant find the solution again. :(
I have my first page which loads a second page into a div through a $.ajax() call. that works fine.
The second page that gets loaded has a form and submits it via ajax. But the form does not send, no result is returned, nothing. zippo....
When i open the second (form) page directly, and submit the form. the form is handled through ajax no problem.
I thought i may had to include the $.ajaxStop() function, but that doesnt seem to work.
Any ideas? Has this been answered already?
Thanx
AJAX not working the 2nd time?
Page 1 of 13 Replies - 3116 Views - Last Post: 13 March 2010 - 10:53 AM
Replies To: AJAX not working the 2nd time?
#3
Re: AJAX not working the 2nd time?
Posted 20 February 2010 - 09:30 AM
Can you post the code for both the pages?
#4
Re: AJAX not working the 2nd time?
Posted 13 March 2010 - 10:53 AM
kinged007, on 03 February 2010 - 12:48 PM, said:
Hi,
I saw this topic on jQuery docs once before, but didnt read it properly, now im having the same problem and cant find the solution again.
I have my first page which loads a second page into a div through a $.ajax() call. that works fine.
The second page that gets loaded has a form and submits it via ajax. But the form does not send, no result is returned, nothing. zippo....
When i open the second (form) page directly, and submit the form. the form is handled through ajax no problem.
I thought i may had to include the $.ajaxStop() function, but that doesnt seem to work.
Any ideas? Has this been answered already?
Thanx
I saw this topic on jQuery docs once before, but didnt read it properly, now im having the same problem and cant find the solution again.
I have my first page which loads a second page into a div through a $.ajax() call. that works fine.
The second page that gets loaded has a form and submits it via ajax. But the form does not send, no result is returned, nothing. zippo....
When i open the second (form) page directly, and submit the form. the form is handled through ajax no problem.
I thought i may had to include the $.ajaxStop() function, but that doesnt seem to work.
Any ideas? Has this been answered already?
Thanx
I would imagine what is happening is that you have something bound to the form submit like
$('form#whatever').submit(function() {
// do ajax form submission here
});
in a script loaded on the main page. This is a trap. The binding doesn't automatically bind to content added to the page later (like your form)
With the latest jQuery, you can do something like this:
$('form#whatever input[type="submit"]').live('click', function() {
// do ajax form submission here
});
If that's the problem, read up on the "live" method in the jQuery docs (or ask for more help here) if you don't get it.
If that's not the problem, well, let's see the code!
Page 1 of 1
|
|

New Topic/Question
Reply


MultiQuote




|