Help with my jQuery
Help with my jQuery
Hallo Guys
I am new here and hope to get some help :)
I am using jQuery to validate a form, where the name/phone/location and email is required!
Now, one of the criteria is :
- the name must contain a space " " and a hyphen -
- the space " " and hyphen - cannot be at the beginning of the name or a the end of the name
The code works but with small issues:
* it validates if the name begins with the hyphen
but does not quite validate if it is ended with the hyphen or space
Example: it works if u type in name field as -name or name-
but if u type mr name- then it will accept it it BUT it should NOT accept it!!
only lowercase, space and hyphens are allowed!!
No space or hyphen at the beginning or at the end of the text is allowed!
If anyone can help, I can provide you with the full code!