9

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.

1 Answer 1

10

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.

3
  • It is worth adding the information about the variable post_max_size which worked for older PHP versions too.
    – AjitS
    Commented Oct 30, 2013 at 5:30
  • @AjitS, I have edit my answer. Thanks for your suggestion. Commented Oct 30, 2013 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
    Commented Oct 30, 2013 at 15:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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