View Full Version : Is there a limit to form fields?
gbuhler
05-12-2004, 08:47 AM
Is there a limit to how many characters I were to put into a hidden text box or into a variable? I might be looking at putting in upwards of 100 000 characters into a variable or a hidden text box in a form. Will this work? Or what is the maximum?
Glen
joh6nn
05-12-2004, 01:40 PM
to the best of my knowledge, the only limiting factor on the size of that sort of variable would be the amount of RAM in the machine running your script. if you wanted to make your variable a million characters in length, you could, supposing you had the RAM to handle a variable of that size.
it would likely be best to assume that most people won't have that sort of RAM, though.
Roy Sinclair
05-12-2004, 03:16 PM
Not only that but you need to be using method="POST" in your form tag, the limits on method="GET" are quite a lot shorter than the 100,000+ characters you're thinking of.
Of course you should really be asking yourself "Why do I need to send so much data to the user and to keep it hidden?". This sounds more like a problem you need to solve by maintaining a server side user state.
gbuhler
05-12-2004, 09:42 PM
Not only that but you need to be using method="POST" in your form tag, the limits on method="GET" are quite a lot shorter than the 100,000+ characters you're thinking of.
Of course you should really be asking yourself "Why do I need to send so much data to the user and to keep it hidden?". This sounds more like a problem you need to solve by maintaining a server side user state.
I have been asked to make a very complex application for a hotel where I've put in the LAN and computers and I figured a Javascript/CGI/HTML based app would be the quickest (they gave me 16 days, ending May 22). To make a long story short, all data for the app is being passed through a form field to a cgi script which is written to a .js file that can be read the next page as variables. This imports the data and makes everything very quick as far as development. So if I'm looking to have lets say 500 entries, each about 200 Characters, or more, will this work??
Thanks
Glen
joh6nn
05-13-2004, 03:19 AM
offhand, i'd say yes, but it might be best to test it on one of the target machines with something like the following:
var theArray = [];
for ( var i = 0; i < 600; i++) {
theArray[i] = "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890";
}
that's 600 entries, of 300 characters each.
gbuhler
05-13-2004, 04:46 AM
Do you think this is an OK way of doing this? or is there an easier way?
Glen
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.