HI,
I have html page where in parent-child relationship
is specified through array which has to be loaded into the select box dynamically.It should display
FATHER
SON
DAUGTHER
AND IT should work in both netscape and IE.
So the array has just before the child element.
But while adding it is not interpreted as spaces.
Also i cannot do document.write since the select box position is fixed and it has to be always placed there ,since the html
page comes with input elements.
Here is the sample code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</head>
<body>
<form id="f1" name="f1">
<select name="S1" id="S1" alt="Select a library context" >
</select>
</form>
<script>
var aBaseLib= new Array("FATHER,FATHER")
var aSubLib=new Array("FATHER"," SON,SON"," DAUGHTER,DAUGHTER")
var sLoadBaseLib =document.f1.S1;
for(var iBaseLib = 0;iBaseLib < aBaseLib.length; iBaseLib++)
{
var sBaseName = aBaseLib[iBaseLib].split(",");
sLoadBaseLib[sLoadBaseLib.length] = new Option(sBaseName[0],sBaseName[1]);
if(aSubLib != "" && sBaseName[0] == aSubLib[0])
{
for(var iSubLib = 1;iSubLib < aSubLib.length; iSubLib++)
{
var sSubName = aSubLib[iSubLib].split(",");
sLoadBaseLib[sLoadBaseLib.length] = new Option(sSubName[0],sSubName[1]);
}
}
}
</script>
</body>
</html>
I have html page where in parent-child relationship
is specified through array which has to be loaded into the select box dynamically.It should display
FATHER
SON
DAUGTHER
AND IT should work in both netscape and IE.
So the array has just before the child element.
But while adding it is not interpreted as spaces.
Also i cannot do document.write since the select box position is fixed and it has to be always placed there ,since the html
page comes with input elements.
Here is the sample code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</head>
<body>
<form id="f1" name="f1">
<select name="S1" id="S1" alt="Select a library context" >
</select>
</form>
<script>
var aBaseLib= new Array("FATHER,FATHER")
var aSubLib=new Array("FATHER"," SON,SON"," DAUGHTER,DAUGHTER")
var sLoadBaseLib =document.f1.S1;
for(var iBaseLib = 0;iBaseLib < aBaseLib.length; iBaseLib++)
{
var sBaseName = aBaseLib[iBaseLib].split(",");
sLoadBaseLib[sLoadBaseLib.length] = new Option(sBaseName[0],sBaseName[1]);
if(aSubLib != "" && sBaseName[0] == aSubLib[0])
{
for(var iSubLib = 1;iSubLib < aSubLib.length; iSubLib++)
{
var sSubName = aSubLib[iSubLib].split(",");
sLoadBaseLib[sLoadBaseLib.length] = new Option(sSubName[0],sSubName[1]);
}
}
}
</script>
</body>
</html>