Jquery validation plugin - TypeError: $(…).validate is not a function

后端 未结 8 1123
不知归路
不知归路 2020-12-01 08:45

My script throw errors:

TypeError: jQuery.validator is undefined additional-methods.js:20 TypeError: $(...).validate is not a function index.php:115

8条回答
  •  星月不相逢
    2020-12-01 09:29

    I had the same problem. I am using jquery-validation as an npm module and the fix for me was to require the module at the start of my js file:

    require('jquery-validation');
    

提交回复
热议问题