I have a drop down menu in a Perl script. I want the drop down to display different information under it, based on what is selected in the drop down. This is my script:
Once I have the Choice value I want to use it to run a SQL query and print it out as part of the script (which is fine) but I when I select a Choice and hit 'Submit Query', the script just hangs. Why could that be?use Win32::ODBC; use CGI qw(:standard); use CGI::Carp qw/fatalsToBrowser/; print "Content-Type:text/html\n"; print "\n"; print "<HTML>\n"; print "<HEAD>\n"; print "</HEAD>\n"; $cgi = new CGI; print start_form(-action=>$cgi->script_name()); print hidden(-name=>'Choice' -value=>$cgi->param('Select')); %labels = ("MA"=>"Mortgage Advisers", "CA"=>"Customer Advisers", "BM"= +>"Branch Management", "HO"=>"Head Office", "Acc"=>"Accord", "MSa"=>"M +CC Sales", "MSe"=>"MCC Service"); print popup_menu(-name=>'Select', -values=>[keys %labels], -default=>'', -labels=> \%labels); print submit(); print end_form(); print "Choice: $Config{'Choice'}\n";
In reply to Drop down and display by kjg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |