Swap out button/submit inputs for button elements
[civicrm-core.git] / CRM / Case / Form / CaseView.php
index 646d48cfd054ea71f88872196b320a05d7ca3691..f2300dadb23e11ae16d1cd37e48ea083b48aa6de 100644 (file)
@@ -272,7 +272,13 @@ class CRM_Case_Form_CaseView extends CRM_Core_Form {
         ['class' => 'crm-select2 crm-action-menu fa-list-ol']
       );
     }
-    $this->addElement('submit', $this->getButtonName('next'), ' ', ['class' => 'hiddenElement']);
+    // This button is hidden but gets clicked by javascript at
+    // https://github.com/civicrm/civicrm-core/blob/bd28ecf8121a85bc069cad3ab912a0c3dff8fdc5/templates/CRM/Case/Form/CaseView.js#L194
+    // by the onChange handler for the above timeline_id select.
+    $this->addElement('xbutton', $this->getButtonName('next'), ' ', [
+      'class' => 'hiddenElement',
+      'type' => 'submit',
+    ]);
 
     $this->buildMergeCaseForm();
 
@@ -517,11 +523,15 @@ class CRM_Case_Form_CaseView extends CRM_Core_Form {
         FALSE,
         ['class' => 'crm-select2 huge']
       );
-      $this->addElement('submit',
+      // This button is hidden but gets clicked by javascript at
+      // https://github.com/civicrm/civicrm-core/blob/bd28ecf8121a85bc069cad3ab912a0c3dff8fdc5/templates/CRM/Case/Form/CaseView.js#L55
+      // when the mergeCasesDialog is saved.
+      $this->addElement('xbutton',
         $this->getButtonName('next', 'merge_case'),
         ts('Merge'),
         [
           'class' => 'hiddenElement',
+          'type' => 'submit',
         ]
       );
     }