in the CGI script,
how to return list of values to keep them in DCT dropdown menu
I have written like this:
$query = "Select * from Locations where Country ='$country' order by State;";
$queryHandle = $dbshop->prepare($query);
$queryHandle->execute();
$queryHandle->bind_columns(undef, \$state, \$country);
while($queryHandle->fetch())
{
push(
@options, $state);
}
$dbshop->disconnect if ($dbshop);
# DBI DISCONNECT
print "Content-type: text/html\n\n";
print qq{
};
in the DCT i am fetching like this
function fetchLocations(locations)
{
var Countries = locations.split(" ");
var optionsArray = new Array();
optionsArray[0] = new Option("Select",true,true);
j=1;
for (i=0;i {
optionsArray[j++] = new Option(Countries
);
}
IWDatacapture.getItem("/organization/city").setOptions(optionsArray);
}
is this best way?