Add the None option for why not willing to wait. #482

This commit is contained in:
Korina Cordero 2020-09-03 03:10:05 +00:00
parent e6dd08d6d0
commit dfb3682088

View file

@ -305,6 +305,7 @@
<div class="col-lg-4">
<label data-field="no_wait_reason">Reason Why Not Willing to Wait</label>
<select class="form-control m-input" id="no-wait-reason" name="no_wait_reason" disabled>
<option value="">None</option>
{% for key, class in no_wait_reasons %}
<option value="{{ key }}"{{ obj.getReasonNotWait == key ? ' selected' }}>{{ class }}</option>
{% endfor %}
@ -1867,13 +1868,20 @@ $(function() {
console.log(field_value);
if (field_value == 'not_willing_to_wait') {
console.log('enable please');
$("#no-wait-reason").attr("disabled", false);
$("#not-wait-notes").attr("disabled", false);
} else {
console.log('disable please');
$("#no-wait-reason").attr("disabled", true);
$("#not-wait-notes").attr("disabled", true);
// remove selected from option that might have already been selected
$("#no-wait-reason option:selected").prop("selected", false);
// set first option
$("#no-wait-reason option:first").prop("selected", "selected");
// empty the reason text field
$("#not-wait-notes").val('');
}
});
});