Im looking for some code to use on my registration form so that if a user enters an invalid character for their username such as * # _ - an error pop up box will appear.
Thanks for reading.
Last edited:
The views expressed on this page by users and staff are their own, not those of NamePros.
That would be javascript if it pops-up. You could use some pretty easy PHP that will just redirect to he reg. page if it encounters an invalid character.
If worried about efficiency/bandwidth
Best to check via JScript or other local handling. Then when you know the data is valid in form, after that POST IT and do database lookup for valid username/password.
You save a whole back and forth trip to server that way. I'm not a strict AJAX purist, but I believe that is one of the things it stresses (I've stopped trying to keep up with all the new acronyms, just read the white paper and try to borrow the best of 'em all... Though sometimes they conflict)