开发者

Lock a button while an AJAX call

开发者 https://www.devze.com 2022-12-13 21:28 出处:网络
On click of a button, I am saving the record to the database. I don\'t want to refresh the page, it must be handled through AJAX.

On click of a button, I am saving the record to the database. I don't want to refresh the page, it must be handled through AJAX.

I have the code for AJAX, I just want to know how to enable/di开发者_JAVA百科sable the Submit button?


This should do the trick.

document.getElementById('submitId').disabled = true;


Assuming:

<input type="submit" id="submit" value="Submit">

then

var submit = document.getElementById('submit');
submit.disabled = true;
0

精彩评论

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