tedspinkle has asked for the wisdom of the Perl Monks concerning the following question:
Hello All,
I'm trying to add a drop down menu in my Perl shopping cart to select the credit card expiration year during checkout, but I'm having a hard time with Perl. I'm trying to generate an option list showing the next 9 years. Here's what I have so far:
($second, $minute, $hour, $dayOfMonth, $month, $yearOffset, $dayOfWeek +, $dayOfYear, $daylightSavings) = localtime(); $year = 1900 + $yearOffset; print '<select name="year">'; for ($year ; $year < $year + 9 ; $year++) { print "<option value=\"$year\">$year</option>\n"; } print '</select>';
Would someone be willing to help me with this? I'm sure this code is not correct. Also, how would you display the menu on an HTML page? I realize that this is over my head, but I'd really like to do this.
Thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Drop Down Year List
by JavaFan (Canon) on Aug 21, 2009 at 00:21 UTC | |
by Tanktalus (Canon) on Aug 21, 2009 at 02:20 UTC | |
|
Re: Drop Down Year List
by bichonfrise74 (Vicar) on Aug 21, 2009 at 00:29 UTC | |
by tedspinkle (Novice) on Aug 21, 2009 at 00:41 UTC | |
|
Re: Drop Down Year List
by imrags (Monk) on Aug 21, 2009 at 09:12 UTC | |
|
Re: Drop Down Year List
by Anonymous Monk on Aug 21, 2009 at 06:23 UTC | |
|
Re: Drop Down Year List
by tedspinkle (Novice) on Aug 21, 2009 at 15:44 UTC | |
by GrandFather (Saint) on Aug 23, 2009 at 21:02 UTC | |
|
Re: Drop Down Year List
by tedspinkle (Novice) on Oct 10, 2009 at 23:00 UTC |