The issue that the below code snippet has is the value of data.status is not conserved out of the ajax.done function. I've already tried as shown in the below snippet to make a hidden input and add the value attribute with the value of data.status. This has also failed. My only conclusion is that the value is only conserved while inside of the ajax.done function even if the value attribute was assigned to the hidden input then outside of the ajax.done function it will return as "undefined". How could I get the value of data.status outside of the ajax.done function.
$.ajax({
method: 'POST',
url: "{{ url_for('admin.adminAccountsValidateUserManagementProcessName') }}"
}).done(function(data) {
console.log(data.status);
$("#hidden-inpt").attr("value", data.status);
console.log("hidden input value: ", $("#hidden-inpt").attr("value"));
});
let status = $("#hidden-inpt").attr("value");
console.log(status);
return false;