I'm using the jQuery Form plugin to post the form with id "myForm", but this seems not to be working. The response of the form is an html table generated using jsp tags. But instead of updating the 'innerHTML' of div with id "divToUpdate", i'm just being sent to a new html page where the html table is displayed. I also tried to alert the returned 'data', but noting happens, and again i'm being sent to a new html page with table. What am i doing wrong?
ps. i thought about the possibility that the path to the .js files might not be correct, so i copied both files to the directory where the jsp containing the above code resides and removed the "../js/" from the path, but unfortunately no success.
Since the problem i am facing is closely related to above problem, i decided not to create a new thread but just add it to this one.
I have the following code
All you need to do is after you add the second form with html(), call the ajaxForm on it like you would in onready. Seems pretty straightforward.
Joined: Dec 27, 2009
Eric Pascarello wrote:All you need to do is after you add the second form with html(), call the ajaxForm on it like you would in onready. Seems pretty straightforward.
Do you mean like this?
This will probably sound very stupid, but why do i need to call '.ajaxForm()' on a form after i have set an event handler to take care of ajax form submission using the same call? What's the point of the call after having set the event handler?
Joined: Nov 08, 2001
You were saying you were adding the form2 after the ready fired so you could not attach it correct? I was saying to do it when you added the form to the page.
I really think we should start a new topic.
Create a new thread and we can talk about it in there.