It uses forms validation by the FormValidation.io plugin which is built into metronic.
But I would also like to use the AutoFocus plugin https://formvalidation.io/guide/plugins/auto-focus/
When trying to join
plugins: {
autoFocus: new FormValidation.plugins.AutoFocus (),
}
I get an error
plugins.bundle.js:3841 jQuery.Deferred exception: FormValidation.plugins.AutoFocus is not a constructor TypeError: FormValidation.plugins.AutoFocus is not a constructor
at _initValidation (http://172.11.12.181:81/assets/js/orders/order-pit36.js:1714:17)
at Object.init (http://172.11.12.181:81/assets/js/orders/order-pit36.js:1735:4)
at HTMLDocument.
at mightThrow (http://172.11.12.181:81/assets/plugins/global/plugins.bundle.js:3557:29)
at process (http://172.11.12.181:81/assets/plugins/global/plugins.bundle.js:3625:12) undefined
jQuery.Deferred.exceptionHook @ plugins.bundle.js:3841
Is it possible to use the autoFocus plugin?
Hi,
The autoFocus plugin is located under src/plugins/formvalidation/dist/js/plugins/AutoFocus.min.js
and needs to be included in the build.
For gulp tools/gulp.config.js
:
For webpack tools/webpack/plugins/plugins.js
:
Then recompile the assets with gulp or webpack.
For more info about using Metronic please check the Theme Documentation
and Video Tutorials.
Regards
Currently getting information.
Is there any solution to this?
g:\best-template\2\tools>gulp --demo1
[14:57:44] Using config ./../gulp.config.json
Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (93)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.14.1
at module.exports (g:\best-template\2\tools\node_modules\gulp-sass\node_modules\node-sass\lib\binding.js:13:13)
at Object.
at Module._compile (node:internal/modules/cjs/loader:1109:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
at Module.load (node:internal/modules/cjs/loader:989:32)
at Function.Module._load (node:internal/modules/cjs/loader:829:14)
at Module.require (node:internal/modules/cjs/loader:1013:19)
at require (node:internal/modules/cjs/helpers:93:18)
at Object.
at Module._compile (node:internal/modules/cjs/loader:1109:14)
g:\best-template\2\tools>
Could you please try to run this command? npm audit fix
Please install node.js v16 https://nodejs.org/en/
Thanks