Java Reference
In-Depth Information
compSpec = compSpec + document.form1.radCPUSpeed[radCpuSpeedIndex].value;
compSpec = compSpec + “\nWith the following additional components\n”;
for (controlIndex = 0; controlIndex < numberOfControls; controlIndex++)
{
element = document.form1[controlIndex];
if (element.type == “checkbox”)
{
if (element.checked == true)
{
compSpec = compSpec + element.value + “\n”;
}
}
}
alert(compSpec);
}
</script>
</head>
<body>
<form action=”“ name=”form1”>
<p>
Tick all of the components you want included on your computer
</p>
<table>
<tr>
<td>
DVD-ROM
</td>
<td>
<input type=”checkbox” name=”chkDVD” value=”DVD-ROM” />
</td>
</tr>
<tr>
<td>
CD-ROM
</td>
<td>
<input type=”checkbox” name=”chkCD” value=”CD-ROM” />
</td>
</tr>
<tr>
<td>
Zip Drive
</td>
<td>
<input type=”checkbox” name=”chkZip” value=”ZIP Drive” />
</td>
</tr>
</table>
<p>
Select the processor speed you require
</p>
<table>
<tr>
<td>
<input type=”radio” name=”radCPUSpeed” checked=”checked”
value=”3.8 GHz” onclick=”return radCPUSpeed_onclick(0)“ />
Search WWH ::




Custom Search