This tag is used to set an area within a form in which the user can type a large amount of text. The textarea’s are basically used for giving comments and free form feedback from visitors.
<TEXTAREA name = "text-id" rows = "n" Cols = "m" Wrap= "Virtual physically off" read only> Initial content </TEXT AREA>
TEXTAREA: Sets an area in a form for lengthy visitor input. Initial content for the text area goes between the opening & closing tags. Rows: This attribute specifies the height of the text area. Cols: This attribute specifies the width of the text area.
Wrap: If you turn wrap off the text is handled as one long sequence of text without line breaks. If you set it to virtual the text appears on your page as if it recognized line breaks but when the form is submitted the line breaks are turned off. If you set it to physical the text is submitted exactly as it appears on the screen line breaks included.
Readonly: It prevents the user to alter the initial content.
The following lines of code will add a TEXTAREA in our sample form.
<HTML> <HEAD><TITLE> TEXT FIELDS</TITLE></HEAD> <BODY BGCOLOR="PINK"> <P ALIGN ="CENTER"><B>ADMISSION FORM</B> <FORM> <P> <INPUT TYPE ="TEXT" NAME="NAME" VALUE="ENTER YOUR NAME:" SIZE="25" MAXLENGTH="30"> NAME<BR><BR> <INPUT TYPE ="PASSWORD" NAME="PASSWD" SIZE="25" MAXLENGTH="30"><BR><BR> <INPUT TYPE ="TEXT" NAME="ADDRESS" SIZE="25" MAXLENGTH="30"> ADDRESS<BR><BR> <INPUT TYPE=”RADIO” NAME=”SEX” VALUE=”MALE” CHECKED>MALE<BR> <INPUT TYPE=”RADIO” NAME=”SEX” VALUE=”FEMALE”>FEMALE<BR> <SELECT NAME =”COUNTRY”> <OPTION VALUE = “INDIA”>INDIA <OPTION VALUE = “AMERICA”> AMERICA <OPTION VALUE = “AUSTRALIA”> AUSTRALIA <OPTION VALUE = “NEW ZEALAND”> NEW ZEALAND <OPTION VALUE = “CHINA”> CHINA </SELECT><B>COUNTRY</B> <TEXTAREA NAME="COMMENTS" ROWS=2 COLS=20 WRAP="VIRTUAL:”> PLACE YOUR COMMENTS HERE: </TEXTAREA> <B> COMMENTS </B> </FORM> </BODY> </HTML>