jQuery does not complain about this. But your JavaScript interpreter does this. Line
jQuery("#audit").val() = newval;
JavaScript syntax is not valid. You cannot assign a value to the result of a function call. Your code says: "call val , get the return value, and then assign newval return value." It does not make sense.
Instead
function auditUpdate(newval) { jQuery("#audit").val(newval); jQuery("#auditForm").submit(); }
source share