TAILIEUCHUNG - HTML in 10 Steps or Less- P8
HTML in 10 Steps or Less- P8:Welcome to HTML in 10 Simple Steps or Less. Our mission in writing this book is to provide a quick and accessible way for you to learn Hypertext Markup Language — the lingua franca of the World Wide Web. We hope this book provides a resource that beginning and intermediate HTML coders can use to improve their Web development skills. It is also our hope that it fills multiple roles as both a teaching tool and a reference once you expand your skills. | 116 Part 7 Task Formatting Text Fields notes The input tag is another empty tag like the br or the img tag meaning it has no closing tag associated with it. By defining a name attribute for each of your form controls you create what is called a name value pair. For example if your text field is named user then when a visitor enters Bobbyj the script receives the name value pair user BobbyJ. The processing script has a variable defined named user that awaits this value. Without a name attribute defined the processing script would simply receive the string Bobbyj and not understand what the string meant. Left undefined text fields default to 20 pixels long. In most browsers the text field is actually one character wider than the number you specify. If you ve ever filled out a Web-based form you ve noticed that more often than not the information you re providing is textual names addresses passwords and comments as well as numeric values like ZIP codes and phone and credit card numbers. Form controls that accept this data are generically referred to as text boxes. This task shows you how to examine the first of these three types the basic text field. These form controls are most commonly used for single-line responses like a name and address and for short numeric values. 1. Enter an input tag. 2. Define a type attribute and set it equal to text as shown here input type text 3. Define a name attribute and set it equal to the appropriate value specified by the processing script. For example input type text name first_name 4. To specify how wide the text field should be define a size attribute setting it equal to a numeric value representing the width of the text field in characters. For example input type text name first_name size 20 5. To specify a maximum number of characters the user can enter into the text field define a maxlength attribute and set it equal to a numeric value as shown here input type text name first_name size 20 maxlength 20 Please purchase PDF .
đang nạp các trang xem trước