HTML Forms: Specifying Maximum Text Typed within an Input Box
You can specify a maximum amount
of text that should be typed within a form input box.
The INPUT tag is used to create input fields within a web page form.
You can specify the
amount of text that may be typed into an input box by including the MAXLENGTH
attribute within your HTML form code.
However, when specifying the MAXLENGTH value, make sure you provide your
visitors with enough space to type in the necessary information.
In the following HTML form example, the MAXLENGTH value specifies that your
visitors may type in 40 characters within this particular input box.
type="text" SIZE="10" MAXLENGTH="40">
By using the
maxlength attribute within your web page forms, you can specify exactly how
much text you want within your form. Use it to your advantage.
More Web Design