1. Christoffer Niska
  2. yii-bootstrap
  3. Issues
Issue #189 resolved

TbButton widget forces request type as POST on button type ajaxSubmit

yourilima
created an issue

when I want to submit a form using the PUT method (for our restfull api) it gets overridden to be POST instead whichever we choose.

we fixed it temporarily like this:

@@ -226,7 +226,7 @@ class TbButton extends CWidget
                return CHtml::htmlButton($this->label, $this->htmlOptions);

            case self::BUTTON_AJAXSUBMIT:
-               $this->ajaxOptions['type'] = 'POST';
+               $this->ajaxOptions['type'] = isset($this->ajaxOptions['type'])?$this->ajaxOptions['type']:'POST';
                $this->ajaxOptions['url'] = $this->url;
                $this->htmlOptions['type'] = 'submit';
                $this->htmlOptions['ajax'] = $this->ajaxOptions;

Comments (3)

  1. Log in to comment