Hello, I have this script which should populate a drop down box depending on
another drop box. The error is somewhere in this code here, but I can't find
it. Any help would be greatly appreciated!
<script language="javas cript">
function subcat(category ,subcategory,de scription)
{
this.category=c ategory;
this.subcategor y=subcategory;
this.descriptio n=description;
}
function Populate(fldval ,frmobj)
{
if(fldval!="")
{
frmobj.drop2.le ngth=0;
frmobj.drop2.op tions[0]=new Option("Subcate gory","");
count=1;
if(quantity[fldval]>0)
{
for(a=0;a<quant ity;a++)
{
if(subcategory[a].category==fldv al)
{
frmobj.drop2.op tions[count]=new
Option(subcateg ory[a].subcategory,su bcategory[a].description);
count++;
}
}
}
}
}
subcategory[0] = new subcat(1,1,"Des ktops");
subcategory[1] = new subcat(4,2,"RAM ");
quantity=2;
</script>
another drop box. The error is somewhere in this code here, but I can't find
it. Any help would be greatly appreciated!
<script language="javas cript">
function subcat(category ,subcategory,de scription)
{
this.category=c ategory;
this.subcategor y=subcategory;
this.descriptio n=description;
}
function Populate(fldval ,frmobj)
{
if(fldval!="")
{
frmobj.drop2.le ngth=0;
frmobj.drop2.op tions[0]=new Option("Subcate gory","");
count=1;
if(quantity[fldval]>0)
{
for(a=0;a<quant ity;a++)
{
if(subcategory[a].category==fldv al)
{
frmobj.drop2.op tions[count]=new
Option(subcateg ory[a].subcategory,su bcategory[a].description);
count++;
}
}
}
}
}
subcategory[0] = new subcat(1,1,"Des ktops");
subcategory[1] = new subcat(4,2,"RAM ");
quantity=2;
</script>
Comment