Adsense
Popular Posts
- Code update from PHP 7.4 to PHP 8.1 - PhpSpreadsheet
- MySQL workbench -"Could not decrypt password cache"
- Code update from PHP 7.4 to PHP 8.1 - Worksheet/Iterator.php
- Rendering HTML tags inside textarea
- axios handle blob type data
- Unix Utils and wget in Windows
- increase mysql query speed
- Setup vi syntax for PHP
- EXCEL return to the next line in the same cell
- Get WAMP running on EC2
Tuesday, May 26, 2015
Freeze submit button when waiting ajax post data
When we update a input box from ajax post, it may delay. When users click the submit button, the old data will be posted. We need to freeze submit button when waiting ajax post data.
Example:
$('#universalModal .modal-body input[name="StudentID"]').val(Obj.student_num);
$('#universalModal .modal-footer button#submitBtn').html('Save and Exit');
$('#universalModal .modal-footer button#submitBtn').prop("disabled", true);
$.post(url, postdata, function(data){
$("input[name='StudentID']").val(null);
$('#universalModal .modal-footer button#submitBtn').prop("disabled", false);
}
});
When the submit button is enables and we click submit button, the StudentID value is update from ajax post. Now we can post all form data vi submit.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment