length of hidden form fields

liunx

Guest
Does anyone know the maximum length of a hidden form field, as in the maximum amount of characters it can contain?<br />
:confused:<!--content-->maxlength="Number"<br />
???<!--content-->wait no... that doesn't work<br />
<br />
you have to write a javascript function that checks to see how many characters are in the box, and if there are too many, it cuts the remaining ones out.<br />
<br />
if you need help with that i can do it or you can post in the javascript forum.<br />
<br />
hope that helps<!--content-->Does he want that or does he just want to know if there's a limit to the amount of text that can go in a form field?<!--content-->If you are wondering what the maximum number of characters it will hold, as DaveSW suggested and I am inclined to think, I believe it is 65k (around 65,000 characters)<!--content-->I don't think that there is a maxlength for the hidden input. I was playing around with it this morning after reading the post and I got 20971520 characters in there with a javascript I wrote.<br />
<br />
<HTML><br />
<HEAD><br />
<SCRIPT LANGUAGE="JavaScript"><br />
function fillObject() {<br />
form1.txt1.value+=form1.txt1.value<br />
form1.len.value="Length: " + form1.txt1.value.length<br />
}<br />
</SCRIPT><br />
<BODY><br />
<FORM NAME="form1"><br />
<INPUT TYPE="hidden" NAME="txt1" VALUE="0123456789"><br />
<INPUT TYPE="button" VALUE="Double"<br />
onClick="fillObject()"><BR><br />
<INPUT TYPE="text" NAME="len" VALUE="Length: 10"><br />
</FORM><br />
</BODY><br />
</HTML><br />
<br />
That code just starts with a hidden input with 10 characters in it, and every time you click the button it doubles the length and displays the length in the text box. My comp started going really slow when I hit 20971520 though, so I stopped, but I bet you can go higher. I doubt you'll ever get 20971520 characters anyway, so I wouldn't worry about it ;).<!--content-->
 
Back
Top