[jQuery] Re: jquery forms with ajax responses

2007-12-20 Thread [EMAIL PROTECTED]
pedalpete, I am having this very same issue. Is there something specific you had to do to get jquery to work on returned forms? Thanks On Dec 18, 5:35 pm, pedalpete [EMAIL PROTECTED] wrote: Thanks for your help Hamish, I just got this working with the ajaxForm plugin.

[jQuery] Re: jquery forms with ajax responses

2007-12-18 Thread Hamish Campbell
I think you need to add return false; to the end of your submit function. This will tell the browser not to redirect to addShift.php after running your function. You should make the action page the 'non-ajax' alternative, so if the function doesn't execute it can continue anyway. On Dec 18,

[jQuery] Re: jquery forms with ajax responses

2007-12-18 Thread pedalpete
Thanks Hamis, I think I'm getting closer, but maybe I'm not putting return false in the right location. I have been able to either stop the redirect, but the form does not get submitted by .ajax. now my jquery code looks like this, but nothing gets submitted. [ code]

[jQuery] Re: jquery forms with ajax responses

2007-12-18 Thread Hamish Campbell
return false; needs to be the _last_ thing it does, so move it to the end of the function.. otherwise it hits return and quits the function without doing anythig else. eg: $(#addShiftForm).submit(function() { // do some stuff return false; }); On Dec 19, 7:54 am, pedalpete [EMAIL

[jQuery] Re: jquery forms with ajax responses

2007-12-18 Thread pedalpete
I've now tried this using the ajaxForm plugin for jquery, and the redirect has stopped, and the form is being submitted, but the success is not being returned even though I can see the successful response via firebug. I have barely made any changes to the ajaxForm example, so I am surprised this

[jQuery] Re: jquery forms with ajax responses

2007-12-18 Thread pedalpete
Thanks for your help Hamish, I just got this working with the ajaxForm plugin.