|
@@ -1,3 +1,7 @@
|
|
|
+function __reset(_input) {
|
|
|
+ _input.val(_input.attr('value') ? _input.attr('value') : '');
|
|
|
+}
|
|
|
+
|
|
|
parentSegment.find('[name="isRemoved"]')
|
|
|
.off('change')
|
|
|
.on('change', function () {
|
|
@@ -26,8 +30,8 @@ parentSegment.find('[name="additionReasonCategory"]')
|
|
|
}
|
|
|
if(form.find('[name="additionReasonCategory"]:checked').val() === 'ON_INTAKE') {
|
|
|
form.find('[if-addition-on-intake]').removeClass('d-none');
|
|
|
- form.find('[data-name="start_date"]').val('');
|
|
|
- form.find('[data-name="prescriber"]').val('');
|
|
|
+ __reset(form.find('[data-name="start_date"]'));
|
|
|
+ __reset(form.find('[data-name="prescriber"]'));
|
|
|
}
|
|
|
else if(form.find('[name="additionReasonCategory"]:checked').val() === 'DURING_VISIT') {
|
|
|
form.find('[if-addition-during-visit]').removeClass('d-none');
|
|
@@ -50,8 +54,8 @@ parentSegment.find('[name="removalReasonCategory"]')
|
|
|
}
|
|
|
if(form.find('[name="removalReasonCategory"]:checked').val() === 'ON_INTAKE') {
|
|
|
form.find('[if-removal-on-intake]').removeClass('d-none');
|
|
|
- form.find('[name="removalEffectiveDate"]').val('');
|
|
|
- form.find('[name="removalReasonMemo"]').val('');
|
|
|
+ __reset(form.find('[name="removalEffectiveDate"]'));
|
|
|
+ __reset(form.find('[name="removalReasonMemo"]'));
|
|
|
}
|
|
|
else if(form.find('[name="removalReasonCategory"]:checked').val() === 'DURING_VISIT') {
|
|
|
form.find('[if-removal-during-visit]').removeClass('d-none');
|