blackjudas has asked for the wisdom of the Perl Monks concerning the following question:
my @days = (1..31); my $days_select = '<select name="arrday"><option></option>'; for (@days) { if ($q->param('arrday') && $q->param('arrday') == $_) { $days_select .= "<option value=\"$_\" selected>$_</option>"; } elsif ($base_vars{'day'} == $_ && $base_vars{'day'} > $q->param('arr +day')) { $days_select .= "<option value=\"$_\" selected>$_</option>"; } else { $days_select .= "<option value=\"$_\">$_</option>"; } } $days_select .= '</select>';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI Programming Style With Empty Params
by merlyn (Sage) on Oct 13, 2001 at 05:53 UTC | |
|
Re: CGI Programming Style With Empty Params
by tstock (Curate) on Oct 13, 2001 at 06:00 UTC | |
by blackjudas (Pilgrim) on Oct 13, 2001 at 06:16 UTC | |
|
Re: CGI Programming Style With Empty Params
by tstock (Curate) on Oct 13, 2001 at 06:40 UTC |