浏览代码

Set additionReasonCategory to ON_INTAKE if added as isRemoved: true

Vijayakrishnan 3 年之前
父节点
当前提交
4d2be2a48e
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      resources/views/app/patient/wizard-partials/common-script.blade.php

+ 4 - 0
resources/views/app/patient/wizard-partials/common-script.blade.php

@@ -173,6 +173,10 @@ parentSegment.find('#frm-add-{{$label}}')
             if(form.find('[name="isRemoved"][value="0"]').is(':checked')) {
                 form.find('[name="additionReasonCategory"]').attr('required', 'required');
             }
+            else if(form.find('[name="isRemoved"][value="1"]').is(':checked')) {
+                form.find('[name="additionReasonCategory"]').removeAttr('required');
+                form.find('[name="additionReasonCategory"][value="ON_INTAKE"]').prop('checked', true); // make ON_INTAKE if in-active
+            }
         }
 
         // require removalReasonCategory if not active