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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

extra tabs in textarea 1

Status
Not open for further replies.

newtoASP

Programmer
Jun 1, 2001
40
US
I have a textarea that displays data from a database. When a user enters / changes text in the textarea, 2 tabs characters are added to the beginning of the text. If I look at the entry in the database after form submission, there are no spaces or tabs at the beginning of the text, and if I check the request.form variable when the form submits, there are no spaces or tabs either. Every time that I submit the form, 2 more tab characters are added. Any idea why?
This is the code that populates and updates:
To display:
<%
...open rs
sMemo_text=stripQuotes(rsAgenda(6))
close rs
%>
...
<TEXTAREA id=txtMemo style=&quot;WIDTH: 385px; HEIGHT: 108px&quot; name=txtMemo cols=40 rows=15><%=sMemo_text%></TEXTAREA>
...

To update:
strSQL=&quot;update ...[rest of sql statement]...
& &quot;Memo_text= &quot;& sqlprep_s(Request.Form(&quot;txtText&quot;),300) & &quot; &quot; _
If I do a response.write strSQL, there are no spaces at the beginning of the string.

The functions stripQuotes and sqlprep_s are:
Function SQLPrep_s(ByVal StringValue, ByRef MaxLength)
If MaxLength > 0 Then
StringValue = Left(StringValue, MaxLength)
End If
StringValue = Replace(StringValue, &quot;'&quot;, &quot;''&quot;)
If StringValue = &quot;&quot; Then
SQLPrep_s = &quot;NULL&quot;
Else
SQLPrep_s = &quot;'&quot; & StringValue & &quot;'&quot;
End If
End Function

Public Function StripQuotes(str)
str=trim(str)
if left(str,1)=&quot;'&quot; and right(str,1)=&quot;'&quot; then
str=mid(str,2,len(str)-2)
end if
StripQuotes=str
end function

Thanks - Greg
 
Try stringing your <TEXTAREA> line out so that the </TEXTAREA> is on the same physical line. This solved a similar problem I had. I was incredulous when I heard it but it worked!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top