I have a form with some inputs and some of those inputs are disabled. Because they are disabled, they won't submit the data that is contained in them. So I use the following jQuery code to remove the disabled
property on submit.
jQuery(function ($) {
$('form').bind('submit', function () {
$(this).find(':input').prop('disabled', false);
});
});
When user clicks the submit button, the disabled
property is removed, the data in those fields are sent, and a file is downloaded (I use headers so user is on same page). However, because the disabled
property is now removed, the user can modify those fields and resubmit the form with their own data, which I do not want.
My question is, how can I modify my code to re-disable those certain fields once the form is submitted.