|
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
<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
<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>")
|