jQuery live submit caugth in infinite loop -
i'm trying submit form using jquery , worked fine until had add confirmation window users can review data before submission, here's code:
$("#create-group-form").live('submit', function(e){ e.preventdefault(); var form = $(this); jconfirm('here display group info...', 'confirm group', function(r){ if ( r ) { form.submit(); } }); });
i'm using jalert plugin jquery works regular confirm prompt different styling, preblem when users click ok on prompt goes again live submit getting stuck in infinite loop.
is there way stop going in again event after confirm? think can unbind somehow haven't found way successfully.
btw i'm using live submit because form in modal window.
thanks in advance!
call form element's submit
method, rather jquery selection's one. means jquery handler won't triggered:
$("#create-group-form").live('submit', function(e){ e.preventdefault(); var form = this; // <-- line changed jconfirm('here display group info...', 'confirm group', function(r){ if ( r ) { form.submit(); } }); });
Comments
Post a Comment