Input Text Box Maximum

 

Input Text Box Maximum

You can specify a maximum amount of text that should be typed within an HTML form input text 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 examples, the MAXLENGTH value specifies that your visitors may type in a specific number of characters into the form.

HTML Code

HTML code viewed within an HTML document:
html-line

<input type="text" maxlength="10">

Browser View

HTML coding viewed through a web browser:
html-line

To view this example, type characters into the form. You will be unable to type more than the specified maxlength value.

HTML Code

HTML code viewed within an HTML document:
html-line

<input type="text" maxlength="15">

Browser View

HTML coding viewed through a web browser:
html-line

To view this example, type characters into the form. You will be unable to type more than the specified maxlength value.

HTML Code

HTML code viewed within an HTML document:
html-line

<input type="text" maxlength="20">

Browser View

HTML coding viewed through a web browser:
html-line

To view this example, type characters into the form. You will be unable to type more than the specified maxlength value.

HTML Code

HTML code viewed within an HTML document:
html-line

<input type="text" maxlength="25">

Browser View

HTML coding viewed through a web browser:
html-line

To view this example, type characters into the form. You will be unable to type more than the specified maxlength value.

 

HTML Code

HTML code viewed within an HTML document:
html-line

<input type="text" maxlength="30">

Browser View

HTML coding viewed through a web browser:
html-line

To view this example, type characters into the form. You will be unable to type more than the specified maxlength value.

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.

For additional information on HTML web page forms, visit the HTML Tutorial section.

Give it a try…

To view the results below, after making changes to the above code, place your cursor at the end of the code and press your space bar on your keyboard.

Here’s the result…

This concludes the Input Text Box Maximum code.

 

 

 
Visit the following pages for a wealth of copy and paste codes and tips:

HTML Tips
Copy and paste special effect HTML codes for your web page.

HTML Codes
An HTML codes chart you can use to copy and paste codes into your web page.

HTML Color Codes
An HTML color codes chart you can use to copy and paste color codes into your web page.

JavaScript Codes
Copy and paste special effect JavaScript codes for your web page.

Web Design Tips
Tips, tricks, and special effect codes for your web page.

HTML Tags
A list of HTML tags.

HTML 5 Tags
A list of the latest HTML tags to be developed.

ASCII Codes
Special text characters and code for your web page.