File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,14 @@ protected function registerAjaxScript()
91
91
{
92
92
$ view = $ this ->getView ();
93
93
94
+ if (!isset ($ this ->ajaxOptions ['type ' ])) {
95
+ $ this ->ajaxOptions ['type ' ] = new \yii \web \JsExpression ('$(this).parents("form").attr("method") ' );
96
+ }
97
+
98
+ if (!isset ($ this ->ajaxOptions ['url ' ])) {
99
+ $ this ->ajaxOptions ['url ' ] = new \yii \web \JsExpression ('$(this).parents("form").attr("action") ' );
100
+ }
101
+
94
102
if (!isset ($ this ->ajaxOptions ['data ' ]) && isset ($ this ->ajaxOptions ['type ' ]))
95
103
$ this ->ajaxOptions ['data ' ] = new \yii \web \JsExpression ('$(this).parents("form").serialize() ' );
96
104
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ php composer.phar require demogorgorn/yii2-ajax-submit-button "*"
71
71
or add
72
72
73
73
```
74
- "demogorgorn/yii2-yii2- ajax-submit-button": "*"
74
+ "demogorgorn/yii2-ajax-submit-button": "*"
75
75
```
76
76
77
77
to the require section of your ` composer.json ` file and run ` composer update ` .
You can’t perform that action at this time.
0 commit comments