I have a function that should detect which item is selected in dropdown list then change the form, this could be hiding form fields or assigning a value to a field. The hiding/showing of fields is working as it should however the value of the field does not update and is staying blank.
if (document.getElementById('service16').value == '4989') {
$('#valuediv16').show();
$('#namediv16').hide();
$('#qtydiv16').hide();
$('#cbdiv16').hide();
} else if (document.getElementById('service16').value == '4946') {
$('#cbdiv16').hide();
$('#valuediv16').show();
$('#value').prop("disabled", false);
$('#namediv16').hide();
$('#qtydiv16').show();
$('#esetdiv16').hide();
document.getElementById('value').value = "11.70";
} else if (document.getElementById('service16').value == '4987') {
$('#cbdiv16').hide();
$('#valuediv16').show();
$('#value').prop("disabled", false);
$('#namediv16').hide();
$('#qtydiv16').show();
$('#esetdiv16').hide();
document.getElementById('value').value = "3.80";
} else if (document.getElementById('service16').value == '4988') {
$('#cbdiv16').hide();
$('#valuediv16').show();
$('#value').prop("disabled", false);
$('#namediv16').hide();
$('#qtydiv16').show();
$('#esetdiv16').hide();
document.getElementById('value').value = "9.40";
}