This forum is no longer open and is for reading/searching only.
Please use our new MachForm Community Forum instead.
MachForm Community Forums » MachForm 2
Drop Down List Limit??
Started 16 years ago by hsarver | 15 posts |
-
Is there a limit to the number of drop down items that can be in a list?
I have a list of 300 items in one field (literally the numbers 1-300). After 255 it changes every choice to 255. Meaning if I choose 291 it saves it as 255 in both the entries dbase and within myPHPadmin.
I'm having to change the whole menu to a simple text box where a number may be entered but it sort of defeats the purpose of eliminating typing.
Any thoughts?
Posted 16 years ago # -
Hmm.. that's odd. MachForm doesn't have any limit on this.
Are those 300 items displayed correctly on the form itself?
So the error only happened in the entries dbase and phpmyadmin?MachForm Founder
Posted 16 years ago # -
Yes, it was REALLY odd. I ended up deleting all the choices and making that field a text box for fill in simply because I was in the middle of using the form. Here's exactly how things happened:
All 300 entries appeared in the pull down menu.
After filling out the form, the user is taken to a confirmation page prior to actually submitting the form (thank Heavens for that added feature!) and that was where we first found choices over 255 were "changed" to either 255 or 249.
First I went into the entries dbase to try to edit individual records---the edits would not save.
Then I went into phpmyadmin to see if I could manually change things there and even there the edits would not take. I would edit a "changed" choice to the higher/correct number, save it, and it would be changed BACK to the lower, incorrect number.
It was simply the strangest thing I have ever encountered.
Posted 16 years ago # -
Oh.. I think you just found a bug with the dropdown!
Apparently, the dropdown is having a maximum 255 items (when submitted).
The bug is due to the datatype being used to store your dropdown is TINYINT, which has a maximum value 255.To fix this bug, edit your ap_form_x table. Search for your dropdown field, it should have fieldtype tinyint(6) unsigned.
Change it to int.
Then, modify your save.php file, around line 431 - 465, search for the word tinyint and replace it with int.
That should extend the maximum items of your dropdown.
Thank you for reporting this!
MachForm Founder
Posted 16 years ago # -
Does this limit still apply?
I'm guessing you have updated this in current versions...I'd like to include a list of ~320 options.
Posted 11 years ago # -
Well I have duplicated my form which seemed to work now...
But when I bulk insert my 320 choices, it gets truncated probably around the 250 mark.
Is there a current workaround for this?I don't see tinyint(6) in the database...
Thanks,
LesPosted 11 years ago # -
This is also the cause I suspect that the form won't save properly... it just hangs if I insert a large dropdown list with several hundred options. All other changes to the form save as normal.
Posted 11 years ago # -
Still having trouble with this. :-$
Perhaps you could take a look?http://www.tenerife-training.net/bike-hire/online-bike-hire-reservation-request/
The Nationality field only shows to Tajikistan...
Posted 11 years ago # -
Hi Les,
Can you contact us directly and let us know the login to your machform panel please?
We'll check it.MachForm Founder
Posted 11 years ago # -
I have sent you the login info via email.
request 40314qvurng
:-)Posted 11 years ago # -
I have tried creating a brand new form with just the nationality, paste from either an openoffice spreadsheet (values only, no formulas) or even simple notepad. Same thing happens. It gets truncated.
Possibly something was corrupted (database) when I accidently dropped an entire spreadsheet colum (a million rows?) into the drop down field list. The admin page pretty much crashed when I did that. What can I say, I'm used to using excel...
Or it could have been the directory name change. Or something else I'm not even remotely familiar with.
So I think the best thing is for me to re-install the software, recreate a new db and try again.
I'm pretty sure that will do the trick.
Either way, I'll let you know how it goes.Posted 11 years ago # -
Well, I uploaded the original files to a new directory, installed a totally new database.
I went straight in and made a drop down list with 259 options and the same thing happened.Truncated at around #238 or #239.
I'll send you the new login details via email.
Posted 11 years ago # -
For those having the same issues, we found out that PHP 5.3.x introduced a new setting called "max_input_vars" which set a limit on this.
The solution, try to edit your init.php file and add this line of code:
ini_set("max_input_vars",3000);
if that doesn't work, you need to edit your PHP configuration file (php.ini) directly and set this value:
max_input_vars = 3000
MachForm Founder
Posted 11 years ago # -
Thanks! I just tried this and it fixed our issue. In addition, our host implemented the suhosin extension and I had to have them increase the following settings:
suhosin.get.max_vars
suhosin.post.max_vars
suhosin.request.max_varsPosted 11 years ago # -
Where do we find the php.ini file
We use shared hosting with ipage.com, what do I ask them?
Posted 11 years ago #
Reply
You must log in to post.