I know this question been ask before, but I have not been able to figure this out from what I have read. I get the following javascript error. I am using Yii 2.0.34 and Chrome Version 81.0.4044.113. I get this error for my signup view.
Uncaught TypeError: jQuery(...).yiiActiveForm is not a function
at HTMLDocument.<anonymous> (signup:1268)
at e (jquery.js:3557)
at t (jquery.js:3625)
(anonymous) @ signup:1268
e @ vendor.min.js?v=1585600788:1
Here is my asset bundle:
class BlueVertAsset extends AssetBundle
{
public $sourcePath = '@themes/minton/dist/blue_vertical/';
public $css = [
'css/bootstrap.min.css',
'css/icons.css',
'css/remixicon.css',
'css/app.min.css',
'css/minton.css',
];
public $js = [
'js/vendor.min.js',
'js/app.min.js',
];
public $depends = [
'yii\web\YiiAsset',
];
}
This is how my javascripts scripts are loaded in the html source page in chrome.
I currently do not. I am only now getting started and cleaning up my theme. The signup view is prepackaged with Yii2 advanced. I have not written any functionality as yet. I am trying to figure out what I am doing wrong which is causing yiiActiveForm to be unknown when you can see from the screenshot I initial posted that jquery.js, yii.js, yii.validation.js, yii.activeForm.js, vendor.min.js, app.min.js are all called in that order before jQuery(’#form-signup’).yiiActiveForm.
I found the issue. The two JavaScript files I that I need to load for my theme has to be listed before YII’s JavaScript files. They are all positioned at the end. Listing them in this order with the activeform client script code right afterwards worked for me. Thanks!