Search Search

#1 worldwide
FREE Coding Lessons

since 1996
   THE BEST WAY to learn ASP & Asp.net!
Advertise Here!
click for details
Credits Host:
DiscountASP.net
Server Admin:
The "Team"
Contact Info.
Charles M. Carroll

my Blog
[prev. Lesson]  Forms: Text Box
     [next Lesson]  Forms: Check Box

Forms - Text Area by John Kauffman & Charles Carroll

Multi-line text boxes are created using the TEXTAREA command as follows:

<TEXTAREA NAME="UserComments" ROWS=5 COLS=50>
... default text is typed here
</TEXTAREA>

Notes: Windows browsers typically provide scroll bars automatically.
Although the TEXT tag does not need to be closed, the TEXTAREA must have a </TEXTAREA>
The TEXTAREA tag (like all of the user-input objects) must be within the form tags discussed earlier.

   filename=/learn/test/FormTextArea.asp

<Test Script Below>


<html><head>
<TITLE>formTextArea.asp</TITLE>
</head><body bgcolor="#FFFFFF">
<form action="FormTextAreaRespond.asp" method="post">
<p>TextArea Example</p>
<p>Please type your special shipping comments:</p>    
<TEXTAREA NAME="shippingComments" ROWS="5" COLS="50">
shipping comments go here
</textarea>
<p><input type=submit value="send in comments!">
</form>
</body></html>

The responder to the form will look like this:

   filename=/learn/test/FormTextArearespond.asp

<Test Script Below>


<html><head>
<TITLE>formTextArearespond.asp</TITLE>
</head><body bgcolor="#FFFFFF">
<%
comm=request.form("shippingcomments")
response.write comm
%>
<hr>
</body></html>

Tip: Want to retain Hard-Returns the User Types?

Then change the form responder:

comm=request.form("shippingcomments")
becomes
comm=request.form("shippingcomments")
comm=replace(comm,vbcrlf,"<br>")

Chaz Wish List
Tall Tip $5
Grande Tip $20
Venti Tip $39
Tip Jar Thanks
2004 Thanks
2005 Thanks
HUGE Tip -love site