I downloaded the cleave.js-master from github, and included the cleave.min.js from cleave.js/dist/cleave.min.js , but My input is not getting formated.
in my console I am having an error
<<
Uncaught Error: [cleave.js] Please check the element
>
what is the cause and how can I solve this?
I'm assuming you're calling Cleave before the element has loaded, which is why it's throwing that error.
Use it like this:
document.addEventListener('DOMContentLoaded', () => {
const cleave = new Cleave(fieldSelector, {
phone: true,
phoneRegionCode: phoneRegionCode
});
});
Thanks @jpcaparas
Exactly, you need to get input element ready in your dom first
nosir, para usar cleave.js es necesario instalar el node.js, y luego correr npm value.js
ahora estoy trabajando con xampp, pero no me esta funcionando las entradas de los formatos, ya tengo los dos
Most helpful comment
I'm assuming you're calling
Cleavebefore the element has loaded, which is why it's throwing that error.Use it like this: