Forums

ASP

This topic is locked

ASP Text Area

Posted 20 Feb 2002 22:05:35
1
has voted
20 Feb 2002 22:05:35 Brian Broerse posted:
Hello:

I am having troubles saving the text area to a variable. Can someone please help me. Here is the text area statement:

<td><textarea name="Results" rows=7 cols=30></textarea>"</td>

I want to save the contents of the text area as a variable so I can use it later to pass into an email. Here is the code that I am using to put it into my email:

<input type="hidden" name="emsg" value="Result">

How can I do this? If someone knows...please help..I have been working on this for 2 days now.

Thanks for your time

Brian




Edited by - thedutchie on 20 Feb 2002 23:00:30

Replies

Replied 21 Feb 2002 10:41:36
21 Feb 2002 10:41:36 Bec C replied:
<font face='Verdana'>The way to 'save' text field data into a variable is the request.form/request.querystring method.

What you should do is add a form action to the page where you have the text fields and assign a link to another page so on clicking submit you move to another page.

In the page where you are submitting to you must request the values from the previous page.

Firstly within the data input page where you have your fields, check the method attached to the form. If you set it to GET, the variables are sent via the URL string whereas the POST method sends it in the body.

In the next page use the following code:

Dim textArea

textArea = request.form("name of your text field here" - this is if you are using POST

or

textArea = request.querystring("name of your text field here" - this is if you are using GET

Hope this helps!



</font id='Verdana'>

Replied 21 Feb 2002 15:34:20
21 Feb 2002 15:34:20 Brian Broerse replied:
So is there no way in which I can store the text area to some sort of variable? If I could just store it to a variable...I would be able to complete this page.

Your feedback/comments are appreciated


Replied 22 Feb 2002 13:39:09
22 Feb 2002 13:39:09 Bec C replied:
Using:

Dim textArea
textArea = request.form("your field"

or

textArea = request.querystring("your field"

sets a variable. It is a question of how many pages you would like to persist the variable.

Using the example I gave to you simply grabs the text value from page1 and stores it into a variable in page 2 - page 2 being where you use the data held within the textArea variable.

Reply to this topic