kjg has asked for the wisdom of the Perl Monks concerning the following question:
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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Drop down and display
by Anonymous Monk on Apr 13, 2006 at 14:08 UTC | |
by kjg (Sexton) on Apr 13, 2006 at 15:54 UTC |