Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Thoughts on handling large quantities of text.

Status
Not open for further replies.

Sam6284

Programmer
Apr 24, 2002
16
FR
I've been asked to create an online survey with 5 <textarea> elements. I need to plan for the response to each question to be a few thousand characters.

This is the construct I've used in the past for other elements such as checkboxes or radio buttons:
Code:
With rs
  .AddNew
  .Fields(&quot;Q1&quot;) = Request.QueryString(&quot;Q1&quot;)
  .Update
End With
Using the GET method, I can write strings containing several dozen characters but at some point, it appears the strings get too long and nothing gets added to the table. Using the POST method, I've only been successful creating a new record with empty fields.

I've considered using
Code:
Request.Form
and writing to a text file but I don't know how write the reference to the <textarea>.

For example, open and closing the file is easy enough, but I'm stuck on the line that actually writes the value to the file:
Code:
     txtfile.Writeline(???)

Or in the RecordSet approach:
Code:
     .Fields(&quot;Q1&quot;) = Request.Form(???)

Many thanks for any assistance you can provide. Below is enough of the actual html so you can see how the various objects are named.

Code:
<html>
  <head>
  </head>
  <body>
    <form name=&quot;Survey&quot; method=&quot;get&quot; action=&quot;SurveyWrite.asp&quot;>
      <table>
        <tr>
          <td>
          	<textarea cols=&quot;70&quot; name=&quot;Q1&quot; rows=&quot;10&quot; wrap=&quot;soft&quot;>Enter your response to Question #1 here.
          </td>
        </tr>
        <tr>
          <td>
          	<input type=&quot;submit&quot; name=&quot;submitButton&quot; value=&quot;Submit Survey&quot;>
          	<input type=&quot;reset&quot; name=&quot;resetButton&quot; value=&quot;Clear Survey&quot;>
          </td>
        </tr>
      </table>
    </form>
  </body>
</html>
 
sam6284,

You will have to be careful when processing a survey because people will put in all sorts of characters. The one that will give you probably the most problems are single and double quotes when adding to an SQL database.

Replace all singel quotes with two single quotes for starters.


fengshui_1998
 
<html>
<head>
</head>
<body>
<form name=&quot;Survey&quot; method=&quot;post&quot; action=&quot;SurveyWrite.asp&quot;>
<table>
<tr>
<td>
<textarea cols=&quot;70&quot; name=&quot;Q1&quot; rows=&quot;10&quot; wrap=&quot;soft&quot;>Enter your response to Question #1 here.</textarea>
</td>
</tr>
<tr>
<td>
<input type=&quot;submit&quot; name=&quot;submitButton&quot; value=&quot;Submit Survey&quot;>
<input type=&quot;reset&quot; name=&quot;resetButton&quot; value=&quot;Clear Survey&quot;>
</td>
</tr>
</table>
</form>
</body>
</html>
---------------
SurveyWrite.asp
---------------
<%

With rs
.AddNew
.Fields(&quot;Q1&quot;) = Request.Form(&quot;Q1&quot;)
.Update
End With

%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top