foreach my $country ( sort keys %cust_main_county ) {
$script_html .= "\nif ( country == \"$country\" ) {\n";
foreach my $state ( sort keys %{$cust_main_county{$country}} ) {
- my $text = $state || '(n/a)';
- $script_html .= qq!opt(what.form.${prefix}state, "$state", "$text");\n!;
+ ( my $dstate = $state ) =~ s/[\n\r]//g;
+ my $text = $dstate || '(n/a)';
+ $script_html .= qq!opt(what.form.${prefix}state, "$dstate", "$text");\n!;
}
$script_html .= "}\n";
}
foreach my $state ( sort keys %{ $cust_main_county{$selected_country} } ) {
my $text = $state || '(n/a)';
my $selected = $state eq $selected_state ? 'SELECTED' : '';
- $state_html .= "\n<OPTION $selected VALUE=$state>$text</OPTION>"
+ $state_html .= qq(\n<OPTION $selected VALUE="$state">$text</OPTION>);
}
$state_html .= '</SELECT>';
keys %cust_main_county
) {
my $selected = $country eq $selected_country ? ' SELECTED' : '';
- $country_html .= "\n<OPTION$selected>$country</OPTION>"
+ $country_html .= qq(\n<OPTION$selected VALUE="$country">$country</OPTION>");
}
$country_html .= '</SELECT>';