First of all be kind, I am new to javascript.
In the following page, can you tell me if I have defined the ObjTyp and
the ObjTypeCnt incorrectly. And if that is correct, why can't they be
seen from within my function ChangeSearch? Yes, the ObjTyp and ObjTypeCnt
are generated by a php script.
Thx in advance, Terry
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script LANGUAGE=JavaSc ript>
var ObjType = new array(
"Binary",
"Emis",
"Gal",
"Glob",
"Open",
"Open&Ems",
"Plan",
"Planet",
"SuprNovRem ",
"");
var ObjTypeCnt = 9;
function ChangeSearch(sr chstr)
{
i = document.SrchFo rm.SearchDB.val ue;
alert('Testing 1... ' + document.SrchFo rm.SearchDB.val ue)
// alert('Testing 2... ' + document.SrchFo rm.SearchDB.opt ions[i].text)
if (i==2)
{
j = 0;
alert("ObjTypeC nt = " + ObjTypeCnt);
while (j < ObjTypeCnt)
{
var myNewOption = new option(j+1, ObjType[j]);
document.SrchFo rm.DetailDB.opt ions[0] = myNewOption;
alert("j = " + j);
j++;
}
}
}
</SCRIPT>
<title>Astronom y Page</title>
<meta http-equiv="content-type"
content="text/html; charset=ISO-8859-1">
</head>
<body>
<div align="center"> <big><big><big> <big><big>Terry 's Astronomy Page</big></big></big></big></big><br>
<form NAME=SrchForm>
<select NAME="SearchDB"
onChange="Chang eSearch()">
<option VALUE=0 SELECTED> Search By
<option VALUE=1>Object
<option VALUE=2>Type of Object
<option VALUE=3>Photogr apher
</select>
<select NAME="DetailDB" >
</select>
</div>
<br>
<br>
</form>
</body>
</html>
In the following page, can you tell me if I have defined the ObjTyp and
the ObjTypeCnt incorrectly. And if that is correct, why can't they be
seen from within my function ChangeSearch? Yes, the ObjTyp and ObjTypeCnt
are generated by a php script.
Thx in advance, Terry
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script LANGUAGE=JavaSc ript>
var ObjType = new array(
"Binary",
"Emis",
"Gal",
"Glob",
"Open",
"Open&Ems",
"Plan",
"Planet",
"SuprNovRem ",
"");
var ObjTypeCnt = 9;
function ChangeSearch(sr chstr)
{
i = document.SrchFo rm.SearchDB.val ue;
alert('Testing 1... ' + document.SrchFo rm.SearchDB.val ue)
// alert('Testing 2... ' + document.SrchFo rm.SearchDB.opt ions[i].text)
if (i==2)
{
j = 0;
alert("ObjTypeC nt = " + ObjTypeCnt);
while (j < ObjTypeCnt)
{
var myNewOption = new option(j+1, ObjType[j]);
document.SrchFo rm.DetailDB.opt ions[0] = myNewOption;
alert("j = " + j);
j++;
}
}
}
</SCRIPT>
<title>Astronom y Page</title>
<meta http-equiv="content-type"
content="text/html; charset=ISO-8859-1">
</head>
<body>
<div align="center"> <big><big><big> <big><big>Terry 's Astronomy Page</big></big></big></big></big><br>
<form NAME=SrchForm>
<select NAME="SearchDB"
onChange="Chang eSearch()">
<option VALUE=0 SELECTED> Search By
<option VALUE=1>Object
<option VALUE=2>Type of Object
<option VALUE=3>Photogr apher
</select>
<select NAME="DetailDB" >
</select>
</div>
<br>
<br>
</form>
</body>
</html>
Comment