Abude Abude - 3 months ago 5
jQuery Question

Avoid double submit in my form JQuery

JSfiddle : CODE

I was trying to send the info with POST; then I added this code to disable the button after submitting one time:

$('input[type=submit]', this).attr('disabled', 'disabled');
return true;

but NOW : the button is disabled and the page is reloaded but the form is not submitting the info ... any solution please

PS: I need a general solution like the code above, my form doesn't have an id, because I need to apply this function to all my forms ....


this resolved my problem : http://stackoverflow.com/a/2830812/1436998

        setTimeout(function() {
            $('input').attr('disabled', 'disabled');
            $('a').attr('disabled', 'disabled');
        }, 50);