<html>
<head>
<title>Pizza</title>
<script type = "text/javascript">
function flip(pizzatype) {
if (pizzatype.value == "A") {
document.forms["pizzaform"].topping.value = "aa";
} else if (pizzatype.value == "B") {
document.forms["pizzaform"].topping.value = "bb";
} else if (pizzatype.value == "C") {
document.forms["pizzaform"].topping.value = "cc";
}
}
</script>
</head>
<body>
<form id="pizzaform" action="#" onsubmit="return false;">
<p>
<input type="button" name="valueA" onclick="flip(valueA)" value="A"/>
<input type="button" name="valueB" onclick="flip(valueB)" value="B" />
<input type="button" name="valueC" onclick="flip(valueC)" value="C" />
</p>
<p>Main Topping: <select name="topping">
<option value="aa" selected="selected">Cheese</option>
<option value="bb">Veggies</option>
<option value="cc">Meat</option>
<option value="dd">Ham & Pineapples</option>
</select></p>
</form>
</body>
</html>
|