How to accepts only character values in HTML5


Is there any simple way I can use to prevent user from accepting numeric values in html text box? I've encountered some features of HTML5 like type="email" etc...

Now is there any feature for accepting only character values?

Answer:
You can use a pattern, like this:
<input name="test" type="text" pattern="[A-Za-z]+">


Source: http://apple.stackexchange.com/

No comments:

Post a Comment