So this is a little weird, when my if statement is false the console log shows that pass never gets added to the myData Object, but if set to true then it does. The if statement is checking to see on submit of the form if pass field is NOT DISABLED then post the pass field along with the others otherwise dont post pass.
$(document).on('submit', '#editaccount', function(event) {
event.preventDefault();
myData = {
contactname: $('input[name=contactname]').val(),
business: $('input[name=business]').val(),
email: $('input[name=email]').val(),
code: $('input[name=code]').val(),
phone: $('input[name=phone]').val(),
priceband: $('input[name=priceband]').val(),
address: $('input[name=address]').val(),
active: $('input[name=active]').val(),
mon: $('input[name=mon]').val(),
tue: $('input[name=tue]').val(),
wed: $('input[name=wed]').val(),
thu: $('input[name=thu]').val(),
fri: $('input[name=fri]').val(),
sat: $('input[name=sat]').val(),
sund: $('input[name=sund]').val(),
adminname: $('input[name=adminname]').val(),
accountid: $('input[name=accountid]').val(),
isadmin: $('input[name=isadmin]').val(),
};
var isDisabled = $('input[name=pass]').is(':disabled');
if (isDisabled == false) {
myData.pass = $('input[name=pass]').val();
}
$.ajax({
url: 'php/editaccount.php',
type: "POST",
data: myData,
success: function(data) {
if ($('input[name=isadmin]').val() == 1) {
$('input[name=accountsearch]').val($('input[name=email]').val());
$('input[name=accountsearch]').submit();
} else {
$('input[name=accountsearch]').val($('input[name=business]').val());
$('input[name=accountsearch]').submit();
}
alert(data);
}
});
console.log(myData);
});