dimanche 22 mai 2016

Javascript RegExp using .test()

I need to validate that the user is text only and I want to use a regexp. Something like: if(/^[a-zA-Z]+$/.test(user)) { show invalid message }

this particular solution wont work, I appreciate the help, im pretty new in JS.

Aucun commentaire:

Enregistrer un commentaire