| The Value Attribute The next attribute is the value attribute. Do not confuse this with the second half of an attribute/value pair. The name of this attribute is value. The value of this value attribute is the text that is between the quotation marks in the attribute/value pair. (Example: value="Text Goes Here") Whatever is between the quotation marks will appear inside the text input field on the webpage form. Most forms that you encounter on the web do not have any text in the text input fields. If you want the input field to be initially blank you will not put anything between the quotation marks. The field will be blank and ready for the user to type something into the field. However, you can place text in the input field by putting the desired text between the two quotation marks. In the example I have set the value of the value attribute to Your Email Address. The Size Attribute The size attribute sets the physical size or length of the input box in the web form. The size is measured in number of characters. A good size for an email address input box is about 30 characters. So in the example I set the value of the size attribute to 30. The Maxlength Attribute The maxlength attribute controls the total number of characters that can be typed into the text input field. Do not confuse this with the size attribute which determines the physical size of the input box. The maxlength attribute tells the form to process only x number of characters of user input. Have you ever typed a long comment into a customer service form and noticed that the form stopped accepting your input after awhile? This happened because you typed in more characters than the maximum number acceptable for that input box. For demonstration purposes I have set the value of the maxlength attribute to 10 in the example above. Type more than ten characters into the input field and observe what happens. ← Back | |



Save to Del.icio.us




