Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

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

You are here: irt.org | FAQ | HTML | Q2070 [ previous next ]

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?'

©2018 Martin Webb