views:

170

answers:

1

Hello,

I will just come right to it.

I need to know how I can return false or true to a submitbutton. I read some other post here, that says it cannot be done from within a ajax success function because it wil return to the ajax context and not the submit event.

Maybe someone has a workaround for this?? also in the context that I am loading a form from another page.

Some background:

I load a form from another page and in the callback, I write the submit function because otherwise I don't have a way to connect to the submit button. In the submit function I check the input for some fields. If everything checks out, it proceeds with the ajax call to a php script.

EDIT

Solved it by using someone els's suggestion to put the ajax call in a click event and when nessesary, use $('form').submit();

thanks in advance for any help

Richard

+1  A: 

In the success callback of the AJAX request which refreshes the form you could reattach the submit event handler to it.

Darin Dimitrov
thanks for your quick answer, I edited my question. The unwanted behaviour is a little different.
Richard