I currently have my code set to disable the submit button when the field is submitted. Is there a way I can make it re-enable the submit button later?
The first half of my code.
$("#segment").submit(function () {
$(':submit').attr('disabled', 'disbled');
The second half of my code.
if (data == 'success') {
$("#segment").slideUp(function () {
$("#segment").after('<div class="approvedMessage">YES</div>');
setTimeout(function () {
$("#segment").slideDown();
$('.approvedMessage').fadeOut();
},
2000);
});
}
Whereas after 2 seconds it slides back down, I also want it to re-enable the form in the second half of the code, right before it slides back down to show the form again.
The form is submitted regardless if the data is false or true, etc. It does a slideUp, I just want the submit button to re-enable itself again before the message text slides down to show the form again.