Add the None option for why not willing to wait. #482 #1377
1 changed files with 10 additions and 2 deletions
|
|
@ -305,6 +305,7 @@
|
||||||
<div class="col-lg-4">
|
<div class="col-lg-4">
|
||||||
<label data-field="no_wait_reason">Reason Why Not Willing to Wait</label>
|
<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>
|
<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 %}
|
{% for key, class in no_wait_reasons %}
|
||||||
<option value="{{ key }}"{{ obj.getReasonNotWait == key ? ' selected' }}>{{ class }}</option>
|
<option value="{{ key }}"{{ obj.getReasonNotWait == key ? ' selected' }}>{{ class }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
@ -1867,13 +1868,20 @@ $(function() {
|
||||||
console.log(field_value);
|
console.log(field_value);
|
||||||
|
|
||||||
if (field_value == 'not_willing_to_wait') {
|
if (field_value == 'not_willing_to_wait') {
|
||||||
console.log('enable please');
|
|
||||||
$("#no-wait-reason").attr("disabled", false);
|
$("#no-wait-reason").attr("disabled", false);
|
||||||
$("#not-wait-notes").attr("disabled", false);
|
$("#not-wait-notes").attr("disabled", false);
|
||||||
} else {
|
} else {
|
||||||
console.log('disable please');
|
|
||||||
$("#no-wait-reason").attr("disabled", true);
|
$("#no-wait-reason").attr("disabled", true);
|
||||||
$("#not-wait-notes").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('');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue