dwiz has asked for the wisdom of the Perl Monks concerning the following question:
I would like some help please with maintaining form state using HTML::Template.
My efforts thus far have been unspectacular to say the least. Maintaining the state with checkboxes is easy but when it comes to dropdown menus it has become tricky. With the dropdowns it easy to generate using my script like:
I then place that in my Template file via its param method.sub StateDrop { my $state = $q->param('state'); my @states = ("1", "2", "3", "4", "5", "6"); my $menu .= qq"<SELECT NAME="state">\n"; foreach my $x (@states) { $menu .= $x eq $state ? "<option selected>$x<\/OPTION>" : "<OPTION>$x< +\/OPTION>"; } $menu .= "<\/SELECT>"; return $menu; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Maintaining form state with HTML::Template
by Arguile (Hermit) on Jun 22, 2001 at 18:28 UTC | |
by dwiz (Pilgrim) on Jun 22, 2001 at 18:45 UTC | |
by TheoPetersen (Priest) on Jun 22, 2001 at 19:39 UTC | |
|
(jeffa) Re: Maintaining form state with HTML::Template
by jeffa (Bishop) on Jun 22, 2001 at 18:24 UTC | |
|
Re: Maintaining form state with HTML::Template
by miyagawa (Chaplain) on Jun 22, 2001 at 20:45 UTC |