use strict;
use warnings;
use DBI;
use Getopt::Long;
my $CGI_params = Vars;
my %CGI_PARAM = %$CGI_params;
$site = "";
$site_selected="a1";
$site = "a1";
$site_selected = $CGI_PARAM{'popup'};
$site = $CGI_PARAM{'popup'};
if($site_selected =~ /^\s*$/) {
$site = "a1";
$site_selected="a1";
}
defined $site or die "usage:$0";
my %map=(a1=>[qw(r_a1_c)],a1=?[qw(r_a2_c)],);
show();
sub show{
status();
header();
}
sub status{
my $stm=$site_selected;
}
sub header
{
print start_form(-method=>"GET",-action=>"db.cgi");
print " <br>  <B>Site</B>  ";
print popup_menu(
-name => 'popup',
-value => keys % map,
-default => 'value2'
);
print "         ";
print submit(-type=>"submit",-name=>"submit",-value=>"submit");
print end_form;
}
Code description:
Whenever i click submit the value should get the selected value from the popup menu.
For example:
Now am getting as follows:
http://ad.sd.an.com/pps/dev/board/1/bin/db.cgi?popup=a1&submit=submit
Expected thing:
If the values are passed(i.e popup contents) inside the submit it should print as follows in the url. If i selected a1 from popup it should display url as follows likewise it should follow for all popup.
http://ad.sd.an.com/pps/dev/board/1/bin/db.cgi?popup=a1&submit=a1
Now the thing is am not the gettign the expected thing .Like the values are not passed properly in the submit.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.