Topic: input mask mask placeholder
jcarvalho priority asked 3 months ago
Hello,
Need help on Inputmask,. want to have mask placeholder as #.
currently 99/99/9999 accepting as for dates.
For example , date field : ##/#/####, for number field , ########
let elem = document.getElementById(fieldId); var msk = Inputmask.getInstance(elem); if(msk == null){ new Inputmask(elem, { inputMask: mask, clearIncomplete: true }); }
Can you please provide a sample to display with # in text field.?
Grzegorz Bujański staff answered 3 months ago
do you mean something like this? https://mdbootstrap.com/snippets/standard/grzegorz-bujanski/6200351
jcarvalho priority answered 3 months ago
function applyMask(fieldId){let elem = document.getElementById(fieldId); var msk = Inputmask.getInstance(elem); f(msk == null){ new Inputmask(elem, { inputMask: mask, clearIncomplete: true,});}}
Here is the function that i have. Want to display the ##### in the input text field allow digits only in text field
Grzegorz Bujański staff answered 3 months ago
Unfortunately the code you added seems to be incomplete.
But if I understand correctly, you would want to change the placeholder to #
even if the input is not focused?
jcarvalho priority commented 3 months ago
function applyMask(fieldId){let elem = document.getElementById(fieldId); var msk = Inputmask.getInstance(elem); f(msk == null){ new Inputmask(elem, { inputMask: mask, clearIncomplete: true,});}}
Here is the function that i have. Want to display the ##### in the input text field allow digits only in text field
jcarvalho priority commented 3 months ago
Can you please help me with the example?
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Priority
- Premium support: Yes
- Technology: MDB Standard
- MDB Version: MDB5 7.1.0
- Device: mac
- Browser: google chrome
- OS: Mac Os
- Provided sample code: No
- Provided link: No