View Full Version : Data validation
11-19-2011, 08:42 AM
I am new to html programming so i am just wondering if this is at all possible to do in HTML i know in Visual Basic programming you could validate the data the user enters in text fields like IsNumeric etc. to make sure the user only entered in numeric for certain fields. I want to know if there is a way i can do this in HTML
11-19-2011, 08:49 AM
Also Is there a way to do something like this: lets say a zip code text field would only need to be 5 characters long (numeric) FOR the United States e.g 71458
can a text field be fixed to only allow the user to enter in 5 numeric characters only?
11-19-2011, 02:14 PM
Let me answer your second question first: To limit the amount of characters that can be written in a text input you set the maxlength attribute.
<input type="text" maxlength="25">
The above limits the character count to 25. And with the size attribute you can influence the basic width of the input. I. e. a size="5" would make the input wide enough to show five characters at once.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.