I have a Input type as password ,when i try using mobile browser i need to enter input value as numeric only.I want to restrict user even though they enter alphabets.
Asked
Active
Viewed 44 times
-3
-
Possible duplicate of [How To Only Allow Alpha Numeric Chars With JavaScript](http://stackoverflow.com/questions/6256008/how-to-only-allow-alpha-numeric-chars-with-javascript) – Nikita Jan 29 '16 at 11:52
2 Answers
1
Looks like you haven't done any prior research.
See: How To Only Allow Alpha Numeric Chars With JavaScript
or
how do i block or restrict special characters from input fields with jquery?
0
when you used password as input type it will show as * if you want to show characters/numbers to user as text you can set as text type and later you can change to password. add condition based on user agent to so mobile specific only
$("#password").focus(function(){
this.type = "text";
}).blur(function(){
this.type = "password";
})

Prathamesh Rasam
- 416
- 4
- 11