in reply to Re: Extracting selected values from HTML Select Menus
in thread Extracting selected values from HTML Select Menus
I've gone for hard coding the drop down but when I select a month, the page just kind of refreshes, I get the 'At end of Input field' message but $filename isn't printed. What gives?use CGI; use Win32::ODBC; use Time::Local; if (!($db=new Win32::ODBC($DSN))) { print "Error connecting to Database\n"; print "Error: " . Win32::ODBC::Error() . "\n"; } $SqlStatement = "SELECT StaffNo FROM FOSInput WHERE Username=\'$ntuser +'\)"; if ($db->Sql($SqlStatement)) { print "SQL failed.\n"; print "Error: " . $db->Error() . "\n"; if ($DebugMode) { print "<HR>$SqlStatement<HR>"; # Debug } } else { while($db->FetchRow()) { print "<form><select name=\"month\" size=\"1\">\n"; print "<option value=\"\">Select a month</option>\n"; print "<option value=\"0305\">March 2005</option>\n"; print "<option value=\"0405\">April 2005</option>\n"; print "<option value=\"0505\">May 2005</option>\n"; print "<option value=\"0605\">June 2005</option>\n"; print "<option value=\"0705\">July 2005</option>\n"; print "</select><input type=\"submit\"></form>\n"; print "At end of Input field\n"; my $filename= $cgi->param('month'); print "$filename\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Extracting selected values from HTML Select Menus
by kjg (Sexton) on Mar 15, 2005 at 11:15 UTC | |
by kjg (Sexton) on Mar 15, 2005 at 11:33 UTC |