Adsense
Popular Posts
- Install APXS in Redhat Linux
- MySQL workbench -"Could not decrypt password cache"
- Transfer modules between sites
- JavaScript, remove trailing insignificant zeros after toFixed function
- Set Windows path command line
- datatable order by nunmeric
- MySQL date created and date modified
- super(props) in React
- PHP, dump varailbes in a format way
- React: connect(mapStateToProps, mapDispatchToProps)
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