Prevent double submission of forms in jQuery

后端 未结 22 1745
旧时难觅i
旧时难觅i 2020-11-22 08:10

I have a form that takes a little while for the server to process. I need to ensure that the user waits and does not attempt to resubmit the form by clicking the button agai

22条回答
  •  再見小時候
    2020-11-22 08:21

    ...but the form is not submitted with any of the POST data it is supposed to include.

    Correct. Disabled form element names/values will not be sent to the server. You should set them as readonly elements.

    Also, anchors cannot be disabled like that. You will need to either remove their HREFs (not recommended) or prevent their default behaviour (better way), e.g.:

    
    

提交回复
热议问题