954,591 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Text Input Field - Limit

Hi,

How do you set a text input field to have a character limit?

Say for example, the user had to enter a postal code of 4 characters, how would you limit the text field to only allow 4 characters?

Thanks,
Ashton.

AshtonHogan
Posting Whiz in Training
210 posts since Jul 2009
Reputation Points: 7
Solved Threads: 1
 

Hi Ashton

You can set a maxlength in the input field. Here is an example:

<input type="text" name="unique_name" value="" size="15" maxlength="4">


Where size is the visible input of the text box, and maxlength is the maximum caracters allowed.

Hope this helps

Kraai
Senior Poster
3,981 posts since Feb 2008
Reputation Points: 76
Solved Threads: 87
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: