7

I have googled and binged and yahooed this question but can't seem to find an answer. I was working on a form that included over 800 fields but the form's submit function would never execute. After I pared the form down, the submit function ran. So now I'm curious if there's an actual built in maximum number of elements.

8

I think, the issue is related to Server configuration, not with Drupal.

There is max_input_vars variable in php.ini which define the maximum number of variable form elements that can be submitted to a single page.

The “max_input_vars” setting in the php.ini file is a relatively new option starting last year from PHP 5.3.9. It allows you to control the maximum number of form elements on a page. Some webpages have a large amount of forms/fields for administrative or page configuration purposes. In those cases, we need to increase the number of this value in order to properly view those pages.

There is also post_max_size variable in php.ini.

post_max_size sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize. If memory limit is enabled by your configure script, memory_limit also affects file uploading. Generally speaking, memory_limit should be larger than post_max_size. If the size of post data is greater than post_max_size, the $_POST and $_FILES superglobals are empty.

You can check the this for more details.

  • It is worth adding the information about the variable post_max_size which worked for older PHP versions too. – AjitS Oct 30 '13 at 5:30
  • @AjitS, I have edit my answer. Thanks for your suggestion. – Jayendra Kainthola Oct 30 '13 at 5:36
  • Thank you. That makes sense. I'm sure I'm hitting one of these limits. My webhost has set max_input_vars to 5000 and post_max_size to 8M. I'll live with the smaller form. – Robbert Oct 30 '13 at 15:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.