elavazhagan perl wrote:
>
> Thanks man...Like babbling ,I have coded for my requirement........Please
> have a glance on the portion of my code .....
> Now almost I got the solution...trying to optimize it...........
>
> *Note:
> *The value of $ country_code is obtained by the following line *
> my $country_code = $cgi->param('COUNTRY_CODE');
> *
>
> <TR HEIGHT="25">
> <TD WIDTH="140" ALIGN="RIGHT">
> <STRONG>Country: </STRONG>
> </TD>
> <TD WIDTH="650" ALIGN="LEFT">
>
> <select id="country" name ="COUNTRY_CODE"
>
> OnChange="Javascript:document.location.href='plant_catalog_new_changes.cgi?REVIEW_REGION='+document.forms[0].REVIEW_REGION.value+'&COUNTRY_CODE='+document.forms[0].COUNTRY_CODE.value;"
> <option value="">Select</option>
>
> \n ~;
>
> if($review_region eq 'Europe')
> {
> my %Europe = (BE => 'Belgium',
> DK => "Denmark",
> FR =>"France",
> DE => "Germany",
> IO => "Great Britain",
> HU => "Hungary",
> PT => "Portugal",
> RU => "Russia",
> ES => "spain",
> SE => "Sweden",
> TR => "Turkey");
>
> my $item="$country_code";
> while (my($key,$value) = each( %Europe))
> {
> my $country_code=$key;
> my $country=$value;
> if ($country_code eq $item) {
> $selected_switch = "selected";
> }
> else {
> $selected_switch = "";
> }
> print qq~ <option value = "$country_code"
> $selected_switch>$country</option> \n~;
> }
> print qq~ </select> \n
> \n~;
> }
>
> elsif($review_region eq 'North America')
> {
> my %North = (US => "U.S.",
> CA => "Canada",
> MX => "Mexico");
> my $item="$country_code";
> while (my($key,$value) = each( %North))
> {
> my $country_code=$key;
> my $country=$value;
> if ($country_code eq $item) {
> $selected_switch = "selected";
> }
> else {
> $selected_switch = "";
> }
> print qq~ <option value = "$country_code"
> $selected_switch>$country</option> \n~;
> }
> print qq~ </select> \n
> \n~;
> }
>
> elsif($review_region eq 'South America')
> {
> my %South = ( AR => "Argentina",
> BR => "Brazil",
> VE => "Venezuela");
> my $item="$country_code";
> while (my($key,$value) = each( %South))
> {
> my $country_code=$key;
> my $country=$value;
> if ($country_code eq $item) {
> $selected_switch = "selected";
> }
> else {
>
> $selected_switch = "";
> }
>
> print qq~ <option value = "$country_code"
> $selected_switch>$country</option> \n~;
> }
> print qq~ </select> \n
>
> \n~;
> }
>
> else
> {
> my %Asia = (AU => "Australia",
> CN => "China",
> IN => "India",
> MY => "Malaysia",
> NZ => "NewZealand",
> PH => "Philippines",
> ZA => "South Africa",
> TW => "Taiwan",
> VN => "Vietnam");
>
> my $item="$country_code";
> while (my($key,$value) = each( %Asia))
> {
> my $country_code=$key;
> my $country=$value;
> if ($country_code eq $item) {
> $selected_switch = "selected";
> }
> else {
> $selected_switch = "";
> }
> print qq~ <option value = "$country_code"
> $selected_switch>$country</option> \n~;
> }
> print qq~ </select> \n
> \n~;
> }
> print qq ~
>
> </TD>
> </TR>
I'm confused. What are you using to embed Perl into your HTML?
Rob
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/