Hi
I am working on a small project whereby I am create a select index in the top of a frame (I guess that’s the correct terminology). Here is my code:
Test.html
<HTML><HEAD><TITLE>Test</TITLE>
<SCRIPT language=javascript>
function selCar(){
var cars = new Array()
var car_select = document.getElementById(“selectCar(this.form)”)
cars[0] = “Holden”
cars[1] = “Ford”
cars[2] = “Mercedes”
for(i=0;i<cars.length;i++){
eval(“document.fmCar.selectCar.options[i]=” + “new Option(‘”+cars[i]+”‘,'”+cars[i]+”‘)”)
}
}
</script>
</head>
<frameset rows=”100,*” frameborder=”no” border=”0″ framespacing=”0″>
<frame src=”topCar.html” name=”topFrame” scrolling=”No” noresize=”noresize” marginwidth=”0″ marginheight=”0″ id=”topFrame” />
</frameset>
<noframes><body>
</body>
</noframes></html>
topcar.html
<HTML>
<body >
<table width=”760″ border=”0″ align=”center” cellpadding=”0″ cellspacing=”0″ class=”borderPage”>
<tr>
<td class=”pageTitle”>Cars </td>
</tr>
<tr>
<td valign=”bottom” class=”content”>
<form name=”fmCar” id=”fmCar” method=”post” action=””>
<table width=”100%” border=”0″ cellspacing=”0″ cellpadding=”2″>
<tr>
<td><strong>Select Car:</strong>
<select name=”selectCar” id=”selectCar”>
<option>–Select Car–</option>
</select>
<input name=”btnShowCar” type=”button” id=”btnShowCar” value=”Show Car Info” onclick=”selectCar(this.form)”/> </td>
<td align=”right”>
<input name=”btnSetDefaultCar” type=”button” id=”btnSetDefaultCar” value=”Save this Car as your Default Car” onclick=”setDefaultCar(this.form)”/>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>
For some reason it doesn’t like =”selectCar(this.form)”. Could some suggest an alternative way of doing it.
Regard
Greg