Text Fields
One of the most commonly used fields is the text field. This is an input field that allows the user to type in a single line of text. For multiple lines of text see "Text Areas" in the following section. Text fields can be used for things such as names, phone numbers, and other user input. Using raw HTML, you can create a text field using the INPUT tag with TYPE text as shown here:
<INPUT TYPE=text NAME="Name"" SIZE=32 MAXLENGTH=32 VALUE="Your name">
Using CGI::Form, this is a call to the method textfield, as shown here:
$q->textfield(-name=>'Name', -default=>'Your name', -size=>32, -maxlength=>32);
-name specifies the name of the field. This value is used later for querying the value of the field during the POST request. -default specifies the default value of the field. -size specifies the size, in characters, of the displayed text field. -maxlength specifies the maximum number of characters allowed for the field.