Get 2024 Templates Mega Bundle!14 Bootstrap, Vue & React Templates + 3 Vector Sets
Get for 99$

Formvalidation.io autofocus


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.<anonymous> (http://172.11.12.181:81/assets/js/orders/order-pit36.js:1741:12)
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?


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


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.<anonymous> (g:\best-template\2\tools\node_modules\gulp-sass\node_modules\node-sass\lib\index.js:14:35)
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.<anonymous> (g:\best-template\2\tools\node_modules\gulp-sass\index.js:166:21)
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


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(