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

HTML forms - limit on number of fields?

Status
Not open for further replies.

andycheese

Programmer
Jun 10, 2002
38
GB
This'll seem like a bizarre question, but when using forms within an html page, is there a limit on the number of input fields that you can use? I have a problem whereby if I try and submit more than 100 fields back to my server, the fields come back as blank. If I reduce the number of fields to less than 100, their entered values are retained.

Anybody got any ideas? (If that made sense?!)
 
I have used moer than 100 fields on a page before - perhaps it is your server side code that is restricting the amount?
 
Thanks for your reply. I have a feeling it's to do with the way our Apache server is configured...
 
Both the get and post methods of handling form data have size limits.

The get method has a limit of 1024 (for really old server versions it's 256) characters.

The post method has a much higher limit of 65536 characters.

If your hitting these limits you can use shorter name/value pairs to cut down on the number of characters your using. Also you can split the information up and pass some information using the get method and some using the post method.
 
Andy,

What server language are you using?
What makes you think it is Apache?
Is the form using Post or Get?

Personally, from what you have explained, I cannot see it being Apache causing this.

Hope this helps

Wullie


The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
wiser3,

can you elaborate? what would the form tag look like? if oyu split the methods, are there any issues accessing the same "action" script at the same time?

There's always a better way. The fun is trying to find it!
 
If your using the post method i doubt your going over its limits - although it is possible.

Here's an example, that i made up, of passing both get and post information.

< form name=&quot;catrequest&quot; onsubmit=&quot;return validateForm(this)&quot; action=&quot;catrequestprocessor.php?site=jsna&lang=eng&form=request+cat&max=10&quot; method=&quot;post&quot;>

Our name/value pairs of the form will get passed using the post method as usual. Plus everything after the question mark will get passed using the get method (In this case 42 characters).

Because the get method data is &quot;hard coded&quot; the same information is passed every time this form is submitted. This is useful if that information is always the same or you have multiple forms. I have multiple forms on my site all processed by the same php program. My php program is able to tell which form it's getting by looking at the get method data.

From the example i made above:
action=&quot;catrequestprocessor.php?site=jsna&lang=eng&form=request+cat&max=10&quot;

A php program could use this get information to know that the form is coming from a web site called &quot;jsna&quot;, it's the &quot;eng&quot;lish version of that site, the &quot;request&quot; type is for a &quot;cat&quot;alog and that i've set a maximun request of &quot;10&quot;.

This is a simple example, but it should give you some ideas on how to use it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top