Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Perlmonks, I have created a long/complex form that POST many hidden fields to the cgi param() function. The form seems to work fine up until approximately 120 or greater fields are submitted. At this point the IE Browser hangs. Are there any recommended fixes to this problem?

Replies are listed 'Best First'.
Re: Max limit on CGI param() function?
by erikharrison (Deacon) on May 02, 2002 at 14:17 UTC

    Use less data :-)

    In all seriousness, this isn't a Perl problem. It is most likely an MIE bug that has problems dealing with the data you send.

    It's worth noting that if you are sending that many hidden fields, you almost certainly need to redsign the program and it's logic. Consider using a cookie. Hidden fields are a simple way to maintain very basic state information, and should not be used for anything you want to be secure.

    Cheers,
    Erik
(jeffa) Re: Max limit on CGI param() function?
by jeffa (Bishop) on May 02, 2002 at 14:28 UTC
    I concur with erikharrison - here is a 'load' testing script for 'smiles' and giggles:
    use CGI qw(:standard); my $numb; print header(); if ($numb = trim(param('numb'))) { print start_form(); print hidden(-name=>"hidden$_") for map { sprintf("%04d",$_) } (0..$numb); print submit('stumbit'), end_form(); } elsif (param('stumbit')) { print ul(map {li($_)} grep /^hidden/, param()); print start_form(), submit('try again'), end_form(); } else { print "Enter number of hidden fields to create: ", start_form(), textfield('numb'), submit('go'), end_form(); } sub trim { my $it = shift; $it =~ s/^\s*//o; $it =~ s/\s*$//o; return $it; }

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
Re: Max limit on CGI param() function?
by thraxil (Prior) on May 02, 2002 at 21:29 UTC

    probably an IE bug. it wouldn't surprise me. eg, Mac IE 5 has a hard limit on the amount of text you can put into a textarea. somewhere around 8K, it just won't let you type in another character. kind of makes certain web-based applications difficult.

    anders pearson

Re: Max limit on CGI param() function?
by dorko (Prior) on May 03, 2002 at 08:12 UTC
    What OS? I know that IE 5.x on 98 has problems with many drop down boxes (i.e. more than ~50, if I remember correctly), but the same HTML renders fine with IE on a NT box. I think it has to do with the way the OSes handle memory.

    Technology is great: When it works.

    Cheers!

    Brent

    -- Yeah, I'm a Delt.