charon
09-26-2002, 10:22 AM
hi,
I want the SELECT form object to display what I pass to them. My code is as below:
<form name="frm" >
<br>
<div align="center"> <font size="1">
<select name="Project" onChange="Loadfile(document.frm.Project.value)">
<option value="">Select Project</option>
<option value="amp">Bukit Indah Ampang</option>
<option value="sri">Sri Hartamas</option>
<option value="pjp">Putrajaya Precinct 9</option>
<option value="pbp">Pusat Bandar Puchong</option>
<option value="pbp">Puchong Indah</option>
<option value="sij">Setia Indah Johor</option>
<option value="bij">Bukit Indah Johor</option>
</select>
</font></div>
</form>
function Loadfile(pageFile)
{
if (pageFile == "bij")
{
document.location="/setiahomes/bij/displaybij.asp?action=index&cid=0";
}
else if (pageFile == "amp")
{
document.location="/setiahomes/ampang/displayamp.asp?action=index&cid=0";
document.frm.Project.value = "amp"
}
else if (pageFile == "pjp")
{
document.location="/setiahomes/spj/displayspj.asp?action=index&cid=0";
document.frm.Project.value = "pjp"
}
else
{
document.location="/setiahomes/sij/displayamp.asp?action=index&cid=0";
}
}
The JV script code failed to do what I want it to be, that is when the OnChange event handler executes the Loadfile function, it will go to another project and I want the Select Option display the name of the project.
Thanks!
I want the SELECT form object to display what I pass to them. My code is as below:
<form name="frm" >
<br>
<div align="center"> <font size="1">
<select name="Project" onChange="Loadfile(document.frm.Project.value)">
<option value="">Select Project</option>
<option value="amp">Bukit Indah Ampang</option>
<option value="sri">Sri Hartamas</option>
<option value="pjp">Putrajaya Precinct 9</option>
<option value="pbp">Pusat Bandar Puchong</option>
<option value="pbp">Puchong Indah</option>
<option value="sij">Setia Indah Johor</option>
<option value="bij">Bukit Indah Johor</option>
</select>
</font></div>
</form>
function Loadfile(pageFile)
{
if (pageFile == "bij")
{
document.location="/setiahomes/bij/displaybij.asp?action=index&cid=0";
}
else if (pageFile == "amp")
{
document.location="/setiahomes/ampang/displayamp.asp?action=index&cid=0";
document.frm.Project.value = "amp"
}
else if (pageFile == "pjp")
{
document.location="/setiahomes/spj/displayspj.asp?action=index&cid=0";
document.frm.Project.value = "pjp"
}
else
{
document.location="/setiahomes/sij/displayamp.asp?action=index&cid=0";
}
}
The JV script code failed to do what I want it to be, that is when the OnChange event handler executes the Loadfile function, it will go to another project and I want the Select Option display the name of the project.
Thanks!