I have a button that is styled with Bootstrap3, not sure if that really matters or not....
<button type="button" class="btn btn-danger" disabled="disabled" id="transmitDirectMail">Send</button>
And I have an jquery ajax that validates an input and enables/disables the button if the value is a valid Direct Mail.
$("#directMailAddress")
.keyup(function () {
transmitToDirectEmail = this.value;
$.ajax({
type: "POST",
url: "./phiMail/ValidateDirectMail.php",
cache: false,
data: { dMail: transmitToDirectEmail }
})
.done(function( msg ) {
if (msg = "0")
$("#transmitDirectMail").prop('disabled', true);;
if (msg = "1")
$("#transmitDirectMail").prop('disabled', false);
});
});
The problem is that setting the prop enables the button. The ('disabled', true) does not disable the button.