开发者

Disabled form not submitting its fields

开发者 https://www.devze.com 2023-01-26 14:11 出处:网络
I am trying to disable the form on my site when the user click the submit button to stop duplicate submissions. Due to there being an input type file on the form the upload can take a while. So far I

I am trying to disable the form on my site when the user click the submit button to stop duplicate submissions. Due to there being an input type file on the form the upload can take a while. So far I have tried this

$("#uploadForm").submit(function () {
    $(":input", th开发者_如何学Gois).attr('disabled', 'disabled');
});

The trouble is that this stops the form sending any data to the web server. Is there some way to disable the form and still have it post the data.


Let it do the submit before disabling:

$("#uploadForm").submit(function () {
    setTimeout(function(){$("#uploadForm :input").attr('disabled','disabled');}, 10);
    return true;
});


I wouldn't disable the input button, this is confusing for the user. I would just overlay the form with a "Uploading.." message. See jQuery BlockUI plugin.


how about using a progress bar when submit is clicked..

http://plugins.jquery.com/project/loading


Disable the submit button not the form


What about just disabling the submit button?

0

精彩评论

暂无评论...
验证码 换一张
取 消