Răsfoiți Sursa

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

Vijayakrishnan Krishnan 4 ani în urmă
părinte
comite
ef2228e075

+ 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>