webstaff: activated Save button in egEditFmRecord only when form is valid
authorGalen Charlton <gmc@equinoxinitiative.org>
Fri, 7 Jul 2017 20:47:08 +0000 (16:47 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 7 Jul 2017 20:47:08 +0000 (16:47 -0400)
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/templates/staff/share/t_fm_record_editor.tt2

index 2b7788c..38f3ea8 100644 (file)
@@ -1,4 +1,4 @@
-<form role="form" class="form-validated eg-edit-fm-record">
+<form role="form" class="form-validated eg-edit-fm-record" name="fm_record_form">
 
   <div class="modal-header">
     <button type="button" class="close"
@@ -61,7 +61,7 @@
     </div>
   </div>
   <div class="modal-footer">
-    <button class="btn btn-primary" ng-click="ok()">[% l('Save') %]</button>
+    <button class="btn btn-primary" type="submit" ng-disabled="fm_record_form.$invalid" ng-click="ok()">[% l('Save') %]</button>
     <button class="btn btn-warning" ng-click="cancel()">[% l('Cancel') %]</button>
   </div>
 </form>