Hi Friends,
Region Item:
Asia
Location (dropdown) Item: It should populate depending on the 'Region' selection)
I'm using formAPI: ('onItemChange') for 'Region' item and making server call as below:
IWDatacapture.callServer("http://"+server+"/iw-bin/fetchLocations.cgi", params);
I'm passing the 'Region' value as a parameter (params) to the cgi file.
If the paramter value is "Asia" then I'm opening 'asia.properties' file to fetch locations from the property file as below:
if($region eq "Asia"){
$file = "asia_locations.properties";
open(FILE, "<$file");
@locationsList = ;
close (FILE);
my $isDefaultSelected = "false";
$locationOptions .= "locations[" . $i++ . "] = new Option('$locations
{$region}{$k}','$k', $isDefaultSelected, $isDefaultSelected);\n";
}
And finally:
print <
<script language="javascript">
var locations = new Array();
// Set up the options object for a locations.
$locationOptions
</script>
EOT
exit;
But it is not populating the 'Locations' dropdown. Any help is appriciated!!!
Thanks in advance..
Sreeni