Yii2: problem on preventDefault

Created on 19 Dec 2017  路  3Comments  路  Source: yiisoft/yii2

in previous yii2 version the script i use is working but once i updated to latest version the script have error in the yii js files and once i replace it with the old version yii.js, yii.activeForm.js and yii.validation,js, it works fine again. I'm not sure the way i code is correct or not, if I did anything wrong pls tell me. :D

this script i put in main.php

This is the error i get

image

Most helpful comment

You have the param e but are trying to access event which is undefined.
You'll need to change event to e.

All 3 comments

You have the param e but are trying to access event which is undefined.
You'll need to change event to e.

yes i did, the error is gone, but it doesn't prevent it submit

@RookieLittle Have a look at this:
https://stackoverflow.com/questions/9347282/using-jquery-preventing-form-from-submitting

I think .on('beforeSubmit' is the wrong way to go.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Kolyunya picture Kolyunya  路  3Comments

sobit picture sobit  路  3Comments

psfpro picture psfpro  路  3Comments

chaintng picture chaintng  路  3Comments

indicalabs picture indicalabs  路  3Comments