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

Form character passing limit?

Status
Not open for further replies.

BlastRadius

Programmer
Nov 13, 2001
38
CA
Is there a limit on the number of characters which can be passed from a form to another page? I have a form which updated information in an access database. The form works fine under normal circumstances. But, I have a situation where the discription field runs quite long about 1900 characters. When the form is submitted the description field is cut off part way and the rest of the forms values are not pass resulting in an error. The are no apostrophies or other punctuation marks in the area where it is cut off. Any advise would be appreated. Can I store the form fields in a session varable before passing the form? or cut the field into two if it is too big?????
 
Well, my understanding is that the length of a form element is 32k and some change -- the normal limit of what is considered an INTEGER datatype -- but have never put this to the test.

However, it would be easy enough to check on the client side if the length of the field is over a certain length like this:

<input type=text name=myText>
<input type=hidden name=myText1>
<input type=hidden name=myText2>

then you would run something like this to check:

<script language=javascript>
function checkText(){
var theString = document.forms[0].myText.value;
if (theString.length > 1000){
document.forms[0].myText1.value = theString.slice(0,theString.length/2);
document.forms[0].myText2.value = theString.slice(theString.length/2+1,theString.length);
document.forms[0].myText.value = '';
}
}
</script>

Where you'd just put the first half in the first hidden field, the second half in the other, wipe the original, and move on.

I suppose you'd need to play around with the target number where you would decide that it was too big to pass on.

Before I went to these lengths to manipulate it, though, I would triple check the code (or even post it here) just to make sure that's what the problem is. I'd be interested to know how this turns out.

:)
Paul Prewett
penny.gif
penny.gif
 
U could use an
Code:
<TEXTAREA style=&quot;visibility:hidden&quot;></TEXTAREA>
and store the values here u could store about 100Kb of text... ________
George, M
 
if you are using form method=get, then there definitely is a limit to how much data can be passed from the form.

if that is the case, then you should change it to method=post

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top