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("ProjID"
strAction = Request.Form("Action"
if strAction="Save" and intProjID <> "" then
'update the database
Response.Write("Comment Length before update: " & Len(Request.Form("Details"
) & "<br>"
'Response.End
SQL = "stp_SaveTheProject" & _
" @intProjectID=" & intProjID & ","& _
"strComments='" & Replace(Request.Form("Details"
,"'","''"
& "'," & _
DBConnection.Execute(SQL)
Response.Redirect "ProjectItem.asp?ProjID=" & intProjID
end if
'get info from database
if Len(intProjID) > 0 then
SQL = "stp_GetTheProject " & intProjID
set rsProject = server.CreateObject("ADODB.recordset"
Set rsProject = DBConnection.Execute(SQL)
If NOT rsProject.EOF = True Then
strDetail = rsProject.Fields("Comments"
end if
end if
%>
<script language="javascript">
function checkSave(){
var intProjID = "<%=Request.Querystring("projid"
%>";
var bolSubmit = true;
if (document.frmAddProj.Details.value.length > 4000) {
alert("You have entered too much information in the details section.\n\nThe maximum amount of text allowable is 4000 characters.\n\nYou currently have "+document.frmAddProj.Details.value.length+" characters."
document.frmAddProj.Details.focus();
bolSubmit = false;
return;
}
alert("Comment length: " + document.frmAddProj.Details.value.length)
if (bolSubmit){ document.frmAddProj.Action.value = "SaveNew";
document.frmAddProj.submit();
}
}
</script>
<form name="frmTest" method="post" action="thispage.asp?projid=<%=intProjID%>">
<input type="hidden" name="action">
<textarea name="details"><%=strDetails%></textarea>
<input type="button" onClick="javascript:checkSave()">
</form>
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("ProjID"
strAction = Request.Form("Action"
if strAction="Save" and intProjID <> "" then
'update the database
Response.Write("Comment Length before update: " & Len(Request.Form("Details"
'Response.End
SQL = "stp_SaveTheProject" & _
" @intProjectID=" & intProjID & ","& _
"strComments='" & Replace(Request.Form("Details"
DBConnection.Execute(SQL)
Response.Redirect "ProjectItem.asp?ProjID=" & intProjID
end if
'get info from database
if Len(intProjID) > 0 then
SQL = "stp_GetTheProject " & intProjID
set rsProject = server.CreateObject("ADODB.recordset"
Set rsProject = DBConnection.Execute(SQL)
If NOT rsProject.EOF = True Then
strDetail = rsProject.Fields("Comments"
end if
end if
%>
<script language="javascript">
function checkSave(){
var intProjID = "<%=Request.Querystring("projid"
var bolSubmit = true;
if (document.frmAddProj.Details.value.length > 4000) {
alert("You have entered too much information in the details section.\n\nThe maximum amount of text allowable is 4000 characters.\n\nYou currently have "+document.frmAddProj.Details.value.length+" characters."
document.frmAddProj.Details.focus();
bolSubmit = false;
return;
}
alert("Comment length: " + document.frmAddProj.Details.value.length)
if (bolSubmit){ document.frmAddProj.Action.value = "SaveNew";
document.frmAddProj.submit();
}
}
</script>
<form name="frmTest" method="post" action="thispage.asp?projid=<%=intProjID%>">
<input type="hidden" name="action">
<textarea name="details"><%=strDetails%></textarea>
<input type="button" onClick="javascript:checkSave()">
</form>