File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,14 @@ protected function registerAjaxScript()
9191 {
9292 $ view = $ this ->getView ();
9393
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+
94102 if (!isset ($ this ->ajaxOptions ['data ' ]) && isset ($ this ->ajaxOptions ['type ' ]))
95103 $ this ->ajaxOptions ['data ' ] = new \yii \web \JsExpression ('$(this).parents("form").serialize() ' );
96104
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ php composer.phar require demogorgorn/yii2-ajax-submit-button "*"
7171or add
7272
7373```
74- "demogorgorn/yii2-yii2- ajax-submit-button": "*"
74+ "demogorgorn/yii2-ajax-submit-button": "*"
7575```
7676
7777to the require section of your ` composer.json ` file and run ` composer update ` .
You can’t perform that action at this time.
0 commit comments