Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q2070 How do you limit the amount of characters in a text box?

irt.org | Knowledge Base | HTML | Q2070 [ previous next ]

Q2070 How do you limit the amount of characters in a text box?

Add the command MAXLENGTH="-" inside the text box command.

The following was submitted by Sunita Mulay

By giving the value to the maxlength attribute of the textbox. This attribute allows you to give a numeric value that specifies the limit of characters. You can also give a specific size to the textbox.

<html>
<head>
  <title>Limit the amount of characters !
  </title>
</head>
<body>
<!-- this textbox will take unlimited no of characters -->
<input type="text" name="" value="">
<br>
<!-- This textbox will take only "10" characters -->
<input type="text" name="" value="" maxlength="10">

<br>
<!--This textbox will take 10 characters and the size of the textbox is also same. -->
<input type="text" name="" value="" maxlength="10" size="10">
</body>
</html>

Feedback on 'Q2070 How do you limit the amount of characters in a text box?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.