I have an input type=\"text\" for names in my HTML code. I need to make sure that it is a string with letters from \'a\' to \'z\' and \'A\' to \'Z\' only, along
input type=\"text\"
You can use javascript test() method to validate name field. The test() method tests for a match in a string.
test()
/^[A-Za-z\s]+$/.test(x) //returns true if matched, vaidates for a-z and A-Z and white space
or
/^[A-Za-z ]+$/.test(x)