CRM-14798 - crmCaseType/edit.html - Only allow saving of valid forms
authorTim Otten <totten@civicrm.org>
Tue, 1 Jul 2014 00:23:09 +0000 (17:23 -0700)
committerTim Otten <totten@civicrm.org>
Tue, 1 Jul 2014 00:23:09 +0000 (17:23 -0700)
partials/crmCaseType/edit.html

index badeea6e7faabce3214d13ce519af6290b030b65..03e81936500f3e7699b3e576cbf20c1ca87c924e 100644 (file)
@@ -2,10 +2,15 @@
 Controller: CaseTypeCtrl
 Required vars: caseType
 -->
+<form name="editCaseTypeFrom">
 <div class="crm-block crm-form-block crmCaseType">
   <div class="crm-submit-buttons">
-    <a ng-click="save()" class="button"><span>Save</span></a>
-    <a ng-href="#/caseType" class="button"><span>Cancel</span></a>
+    <span class="crm-button">
+      <input type="button" ng-click="save()" ng-disabled="editCaseTypeFrom.$invalid" value="Save" />
+    </span>
+    <span class="crm-button">
+      <input type="button" ng-click="goto('caseType')" value="Cancel" />
+    </span>
   </div>
 
   <div ng-include="partialUrl('caseTypeDetails.html')"></div>
@@ -52,7 +57,12 @@ Required vars: caseType
 
   <!--<button ng-click="dump()">Log</button>-->
   <div class="crm-submit-buttons">
-    <a ng-click="save()" class="button"><span>Save</span></a>
-    <a ng-href="#/caseType" class="button"><span>Cancel</span></a>
+    <span class="crm-button">
+      <input type="button" ng-click="save()" ng-disabled="editCaseTypeFrom.$invalid" value="Save" />
+    </span>
+    <span class="crm-button">
+      <input type="button" ng-click="goto('caseType')" value="Cancel" />
+    </span>
   </div>
 </div>
+</form>
\ No newline at end of file