<html>
<form name="orderForm">
<input type="checkbox"
name="peppers">Peppers<br>
<input type="checkbox"
name="sausage"
onFocus="chooseExtraCheese()">Sausage<br>
<input type="checkbox"
name="cheese">Extra Cheese<hr>
<input type="button"
value="Order Pizza"
name="orderButton"
onClick="alert('ordered.')">
</form>
<script language="JavaScript">
<!--
function chooseExtraCheese()
{
if(document.orderForm.sausage.checked == false)
{
document.orderForm.cheese.checked = true;
}
}
document.write("checkbox onFocus event handler: ");
document.write(document.orderForm.sausage.onFocus);
-->
</script>
</html>
|