i can't find any information inside the w3c html strict spec http://www.w3.org/TR/html4/sgml/dtd.html
I don’t think there’s a maximum number of input
elements in a form given by the spec, if that’s what you are asking. If you have many inputs and want to make sure the form works, you’ll have to try on the clients you support. And of course, it would be much better to redesign the form, if that’s possible.
PHP USERS:
If you are using php to process your form take note that php has a max_input_vars setting in the php ini file. I believe the default is 1000.
I ran into this while building a cakephp app. To see if this is affecting your post, count how many rows of data you are putting into the form and then count how many rows are actually posted back.
So essentially your form would be limited by the number of input vars you have.
This isn't really an direct answer to the OP but I think it would be helpful for anyone searching for a limit on input fields.
To my knowledge, there is no upper limit to the number of form elements (<input>
or otherwise) in an HTML document.
However, if you have a huge number of form elements on your page, you might end up with a POST request that is too large to be processed by the web server (the maximum size of POST requests depends on the server configuration).
I don’t think there’s a maximum number of input
elements in a form given by the spec, if that’s what you are asking. If you have many inputs and want to make sure the form works, you’ll have to try on the clients you support. And of course, it would be much better to redesign the form, if that’s possible.
I don't think that there is a limitation on the number of unput fields in the standards.
There are two practical limitations that you need to consider:
Some browsers start to act up if there are too many input fields on a page. I haven't tried this with recent versions, but I remember testing this a few years back, and then I found that Internet Explorer behaved badly when the number of fields was closing to a hundred.
Too many input fields on a page is just inconvenient, and perhaps a bit scary, to the user. Split the input on several pages, or show placeholders and add input fields dynamically only where they are actually used.
Technically, there is no maximum number of input fields that can be put on a page. Practically, for a user, it is a bit inconvenient for a user to use/see all of the input fields if a web page has a large number of input fields.
I was encountering a similar problem in an old application. I thought it was a limit to the number of HTML input elements or PHP ini configuration for max_input_vars.
But after more investigation, it turns out it was Suhosin that was installed on my production machine which over wrote the PHP.ini config value with a much lower limit.
suhosin.post.max_vars = 400
Please note that we cannot set this max_input_vars directive in run-time with function ini_set. We can change it directly in php.ini file.
; How many GET/POST/COOKIE input variables may be accepted
max_input_vars = 2000
Don't forget to restart web server. Sometimes we need to reboot the server to take effect.
I just also ran into this problem. I automatically created several hundred rows of inputs and they would old send 1/2 of the variables. I checked by using print_r Vars_Dump, If I just created 20 rows, it all went without problems. There is a limit of how many variables can be sent. max_input_vars is limited to 1000 on default. I contacted my hosting provider and they changed the php.ini accordingly.
© 2022 - 2024 — McMap. All rights reserved.