更新时间:2022-11-12 09:24:05
You can use javascript test()
method to validate name field. The test()
method tests for a match in a string.
/^[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)