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

Maximum length of string in textarea? 2

Status
Not open for further replies.

JuanitaC

Programmer
Feb 21, 2001
292
CA
Does anyone know the maximum length of string that can be put into and retrieved from an HTML textarea?

My page gets a string from the database with a length of 2617 characters. When I go to save that page - without changing anything on the page, the length of string returned to the program from the textarea is only 2497...

Any ideas what is happening to the last part of my string??

Edited sample of my code:
<%
intProjID = Request.QueryString(&quot;ProjID&quot;)
strAction = Request.Form(&quot;Action&quot;)

if strAction=&quot;Save&quot; and intProjID <> &quot;&quot; then
'update the database
Response.Write(&quot;Comment Length before update: &quot; & Len(Request.Form(&quot;Details&quot;)) & &quot;<br>&quot;)
'Response.End
SQL = &quot;stp_SaveTheProject&quot; & _
&quot; @intProjectID=&quot; & intProjID & &quot;,&quot;& _
&quot;strComments='&quot; & Replace(Request.Form(&quot;Details&quot;),&quot;'&quot;,&quot;''&quot;) & &quot;',&quot; & _
DBConnection.Execute(SQL)
Response.Redirect &quot;ProjectItem.asp?ProjID=&quot; & intProjID
end if

'get info from database
if Len(intProjID) > 0 then
SQL = &quot;stp_GetTheProject &quot; & intProjID
set rsProject = server.CreateObject(&quot;ADODB.recordset&quot;)
Set rsProject = DBConnection.Execute(SQL)

If NOT rsProject.EOF = True Then
strDetail = rsProject.Fields(&quot;Comments&quot;)
end if
end if
%>
<script language=&quot;javascript&quot;>
function checkSave(){
var intProjID = &quot;<%=Request.Querystring(&quot;projid&quot;)%>&quot;;
var bolSubmit = true;
if (document.frmAddProj.Details.value.length > 4000) {
alert(&quot;You have entered too much information in the details section.\n\nThe maximum amount of text allowable is 4000 characters.\n\nYou currently have &quot;+document.frmAddProj.Details.value.length+&quot; characters.&quot;)
document.frmAddProj.Details.focus();
bolSubmit = false;
return;
}
alert(&quot;Comment length: &quot; + document.frmAddProj.Details.value.length)

if (bolSubmit){ document.frmAddProj.Action.value = &quot;SaveNew&quot;;
document.frmAddProj.submit();
}
}
</script>

<form name=&quot;frmTest&quot; method=&quot;post&quot; action=&quot;thispage.asp?projid=<%=intProjID%>&quot;>
<input type=&quot;hidden&quot; name=&quot;action&quot;>
<textarea name=&quot;details&quot;><%=strDetails%></textarea>
<input type=&quot;button&quot; onClick=&quot;javascript:checkSave()&quot;>
</form>
 
Im not sure what your problem is, but ive used upto 8000 characters in a textarea.
 
what are the characters before and after the point of 2497 ?? Maybe there is an illegal character there that is stopping any more being returned?

just guessing though Tony
reddot.gif WIDTH=400 HEIGHT=2 VSPACE=3

 
Try outputting the string to the screen just as text and then you'll know if the problem is the textarea or not.
 
Thanks everyone... the problem was the stored procedure... I added to the length of the table and forgot to increase the size of my input parameter.

Weird thing is, the size still changes from when it gets it from the database and when it gets it from the form, but the whole string is there.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top