Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help fix inuput type number #450

Closed
MrMegamind opened this issue Sep 1, 2016 · 5 comments
Closed

Help fix inuput type number #450

MrMegamind opened this issue Sep 1, 2016 · 5 comments

Comments

@MrMegamind
Copy link

Hey buddy
If i try to mask for a USA number on <input type="number' ... it gives error. Can you please help fix this ?

Thank you in advance

MAK

@ncovercash
Copy link

The number field doesn't allow non-numeric characters. Also, please give us a traceback and the code you are using

@MrMegamind
Copy link
Author

hi
I am doing

$(document).ready(function(){
$('#usnum').mask('(000) 000-0000');
}

I understand now that it does not work because number can not show brackets like "("

But then how do I show a numeric pad on phone while applying this mask to it ? If I do <input type="text" it shows full keyboard not numeric only.

@clifforama
Copy link

Possibly related: <input type="number" data-mask="00" ...> allows unlimited hyphens, at least in Chrome. In Edge, it allows unlimited non-numeric characters.

@igorescobar
Copy link
Owner

Guys, fields like number, date, email or anything different than text it is completely handled by the browser via javascript I can't control its behaviour. So basically if your not using type text the plugin can't interfere on what the browser is doing with it so even if I wanted to put text in a NUMBER field the browser wouldn't allow. So there isn't much I can do to help.

@hotwheel16
Copy link

You can use inputmode="foo" to pull up a number only mobile keyboard layout.

eg. <input type="text" inputmode="decimal" /> or <input type="text" inputmode="numeric" />

See: https://css-tricks.com/better-form-inputs-for-better-mobile-user-experiences/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants