diff --git a/library/Icinga/Web/Form.php b/library/Icinga/Web/Form.php index 08cb02388..679091fde 100644 --- a/library/Icinga/Web/Form.php +++ b/library/Icinga/Web/Form.php @@ -1086,6 +1086,24 @@ class Form extends Zend_Form return $name; } + /** + * Set the action to submit this form against + * + * Note that if you'll pass a instance of URL, Url::getAbsoluteUrl('&') is called to set the action. + * + * @param Url|string $action + * + * @return $this + */ + public function setAction($action) + { + if ($action instanceof Url) { + $action = $action->getAbsoluteUrl('&'); + } + + return parent::setAction($action); + } + /** * Set form description * diff --git a/public/js/icinga/events.js b/public/js/icinga/events.js index 775b99eff..4d4ae736c 100644 --- a/public/js/icinga/events.js +++ b/public/js/icinga/events.js @@ -200,8 +200,7 @@ var icinga = self.icinga; // .closest is not required unless subelements to trigger this var $form = $(event.currentTarget).closest('form'); - var regex = new RegExp('&', 'g'); - var url = $form.attr('action').replace(regex, '&'); // WHY?? + var url = $form.attr('action'); var method = $form.attr('method'); var $button = $('input[type=submit]:focus', $form).add('button[type=submit]:focus', $form); var $target;