I am having an issue getting my Ajax post to disable the button that I have to submit the data. Below is my code, I've looked around and everything looks right to me but its not disabling the button, I've tried to use $("#refreshButton").attr("disabled", true);
and $("#refreshButton").removeAttr("disabled");
but it didn't work either.
$(document).ready(function () {
$.ajax({
type: "POST",
async: false,
beforeSend: function (request) {
$("#refreshButton").attr("disabled", true);
request.setRequestHeader("AUTHORIZATION", authorizationToken);
},
url: url,
dataType: "xml",
success: function (xml) {
//Do Something here
});
},
error: function (x, status, error) {
//errors
}
});
})
$("#refreshButton").removeAttr("disabled");
This is my button:
<input id="refreshButton" type="button" onclick="RefreshDataSubmit();" value="Refresh"/>
Thanks for any help anyone can provide.