begood321 has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/local/bin/perl -w use strict; use CGI qw(:standard); # Include standard HTML and CGI +functions use CGI::Carp qw(fatalsToBrowser); # Send error messages to b +rowser my @foodmenu = ['Pizza','Garlic Bread','Apple Pie','Ice Cream']; &printheader; if (param()) { &displayorder; } &printform(@foodmenu); &printtail; sub printheader { print header(), start_html(-title=>"Pizza Order Form", -bgcolor=>"#00CCFF"), h1("Mikey's Pizza Delivery Service"), hr; } sub printtail { print address("pizzaman\@pizza.co.uk"), end_html(); } sub printform { my $foodchoices = $_[0]; print h1("Order your food here"), start_form(), "What's your name? ", textfield("name"), p, "What's your phone? ", textfield("phone"), p, "Food order? ", checkbox_group(-name=>'food', -values=>\@$foodchoices, -columns=>2, -multiple=>'true'), p, submit("Submit form"), reset("Clear form"), end_form(); } sub displayorder { print h1("You have ordered..."); print "<UL>"; foreach my $key (param) { my @values = param($key); print "<LI><B>$key:</B> "; print join(", ",@values),"</LI>\n"; } print "</UL><HR>"; }
gives me this error message / Software error: Malformed multipart POST
Hello fellow monks, I'm trying to submit 1 or multiple values to be shown in displayorder subroutine
I also tried setting values from food array in printform subroutine directly but still getting error above. However, my preference is the array solution from within printform sub as stated in code presently because I'm getting lots of values where I need to provide checkboxes for user selection choices. Any help is greatly appreciated, thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl CGI checkbox_group submit error
by daxim (Curate) on Jul 15, 2013 at 17:13 UTC | |
by begood321 (Novice) on Jul 15, 2013 at 18:46 UTC | |
|
Re: Perl CGI checkbox_group submit error
by poj (Abbot) on Jul 15, 2013 at 18:03 UTC | |
by begood321 (Novice) on Jul 15, 2013 at 18:56 UTC | |
by poj (Abbot) on Jul 15, 2013 at 19:05 UTC | |
by begood321 (Novice) on Jul 16, 2013 at 03:03 UTC | |
by poj (Abbot) on Jul 16, 2013 at 10:18 UTC | |
| |
by Anonymous Monk on Jul 16, 2013 at 03:12 UTC |