SyntaxFix
Write A Post
Hire A Developer
Questions
You can use HTML5 pattern attribute to do this:
<form> <input type='text' pattern='[A-Za-z\\s]*'/> </form>
If the user enters an input that conflicts with the pattern, it will show an error dialogue automatically.