فهرست منبع

Auto-submit new-patient-intake section on every change

Vijayakrishnan Krishnan 4 سال پیش
والد
کامیت
ef2228e075
2فایلهای تغییر یافته به همراه12 افزوده شده و 0 حذف شده
  1. 6 0
      gem/templates/form.blade.php
  2. 6 0
      storage/sections/new-patient-intake/form.blade.php

+ 6 - 0
gem/templates/form.blade.php

@@ -51,5 +51,11 @@ $formID = rand(0, 100000);
                 span.text(value.join(', '));
             }
         }
+
+        // submit here
+        let form = $(_field).closest('form');
+        $.post(form[0].action, form.serialize(), function(_data) {
+            console.log('Submitted!');
+        });
     }
 </script>

+ 6 - 0
storage/sections/new-patient-intake/form.blade.php

@@ -1008,5 +1008,11 @@ $formID = rand(0, 100000);
                 span.text(value.join(', '));
             }
         }
+
+        // submit here
+        let form = $(_field).closest('form');
+        $.post(form[0].action, form.serialize(), function(_data) {
+            console.log('Submitted!');
+        });
     }
 </script>