|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
javascript form validation check for first part of word
i want my form to check for a certain word in a login field. if the user enters home/username i want it to yell at them and tell them not to include "home/" when entering their username. i've found all sort of help on form validation for javascript, but none of it talks about checking for a first part of a word. thanks.
|
|
#2
|
||||
|
||||
|
You could use a regular expression. Google for regular expressions and javascript. The other way would be to loop through each of the first 5 letters in the login field value and see if it adds up to 'home/'.
Hope this helps. |
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > javascript form validation check for first part of word |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|