mardi 3 mars 2015

HTML required character set for form fields

As a disclaimer I will let you all know I am a Tier 2/3 system admin/support tech by trade and know enough of HTML,CSS,JS thanks to being curious, books by John Duckett and W3schools.com and having to take these classes for my bachelors degree. So I am in no way, shape or form claiming to be a web designer but I have been working on a mini project and am liberally stumped trying to figure this out.


The question is the following.


I have created an online forum with a username and password field. The problem is that I would like to add restrictions on the input to weed out invalid username formats. (Valid username will start with the first 3 characters as XYZ). Is there anyway I can set up a rule that if the first 3 letters of username STARTS with let's say ABC, the Submit button will grey out and display a message that that username is not valid before it checks with the server? But if the user types the required beginning format letters correctly then the Submit button will be enabled?


I tried making the code using the same principals as the @ sign being required in an email address but have had strange results.


All help will be appreciated!


Mike.





Aucun commentaire:

Enregistrer un commentaire