*********************
*********************
Here is the server side code:
*********************
*********************
print qq(
Content-type: text/html\n\n
<script language="javascript">
//Populating an associative array
var arrData = new Array();
var arrCategory = new Array();
var arrFeatures = new Array();
);
foreach my $key1 (keys %modelFeatures)
{
print INLINELOG $key1."\n";
print qq(
arrCategory[$outer] = '$key1';
arrFeatures[$outer] = new Array();
);
my $ref = $modelFeatures{$key1};
for (my $counter=0;$counter<
@$ref;$counter++)
{
print qq(document.write("arrFeatures[$outer][$counter] = '
@$ref[$counter]'")

;
print INLINELOG "Array value : ".
@$ref[$counter]."\n";
}
$outer++;
}
*********************
*********************
Here is my formapi code:
*********************
*********************
function fnPopulateClient(arrTrim, arrCategory, arrFeatures)
{
IWDatacapture.displayMessage("Back from callserver");
var dropdown = IWDatacapture.getItem('/cntFeaturesPage/optTrim');
for (var i in arrTrim)
{
if (dropdown.getValue() != null)
{
if (dropdown.getOptions()[dropdown.getValue()].value == i)
newOption = new Option(arrTrim
, arrTrim, false, true);
else
newOption = new Option(arrTrim, arrTrim, false, false);
} else
{
newOption = new Option(arrTrim, arrTrim, false, false);
}
dropdown.addOption(newOption);
}
for (var iOuter = 0; iOuter {
alert (arrCategory[iOuter]);
alert(arrFeatures[iOuter].length);
}
}
*****************************************************
The length of the array comes as 0 and values are coming as undefined
*****************************************************