Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
What is the maximum number on lines one can have in the html component like this:
<SELECT name="email_list" size=10 multiple>
<OPTION value="app">Apples
<OPTION value="ban">Bananas
<OPTION value="chr">Cherries
<OPTION value="grp">Grapes
<OPTION value="prs">Pears
<OPTION ...
<OPTION ...
<OPTION ...
</SELECT>
????

I think the size is unlimited, only the free memory left for the browser will limit the number of rows. And proper sense of course...

I have built Select lists that were database driven and would have literally hundreds of items. However, as Khalid said, the memory on the client computer can cause a problem. Not so much how much physical memory as much as how the OS handles memory. We had problems in the past with Win95 & Win98 machines on forms with many select lists with many opotions.
Michael J

If just made a simple php-script to try and generate as much option-tags within a select-tag with a for-loop.
for ($counter = 1; $counter<100000; $counter++)
{
echo "<option>$counter</option>\r\n";
}I used Mozilla Firefox as a browser. It took a while before the php-engine on my pc had finished the list, and the browser took some have cpu-load in that period, but afterwards I was able to see 69236 option-tags, the html-file was 1477 kbytes.
The generation was stopped because a time-out occured in the php-script...
My pc isnt a real fancy one, so I think it is possible to get some more lines with a more modern computer...What page are you looking where you can only see 731 lines?

This is actually somewhat interesting. I gave it a shot myself, and went all the way to 1,000,000 options.
I used Javascript so everything was done in the browser. The script took a while to run, and as you can see it was very resource intensive. It used about 4 solid minutes of CPU time, and over 200MB if RAM. If you notice, my system's commit charge was about 700MB at that time, 68% of my physical RAM, probably the most I've ever used at one time :)
Since I used Javascript, IE told me the page was only 182 bytes. However, to get the size of the complete generated file I wrote a quick C program to generate the same file, WAY faster than the Javascript one (4 mins versus about 2 secs). The result was a 23.7MB file.
So, in the end it seems directly tied to your system's resources. Not CPU power so much, but moreso your RAM. After the script finished running, IE had used about 4 minutes of CPU time and over 200MB of RAM. That's impressive for a web page :)

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |