/*
JavaScript Unleashed, Third Edition
by Richard Wagner and R. Allen Wyke
ISBN: 067231763X
Publisher Sams CopyRight 2000
*/
<html>
<head>
<script language = "JavaScript">
function quickSelect() {
var bnd = document.form1.band.value
bnd = bnd.toUpperCase()
if (bnd == "OASIS") {
document.form1.songs[4].selected = "1"
}
}
</script>
</head>
<body>
<form name="form1">
Favorite Band:
<input type=text name="band" size=20 onBlur="quickSelect()"><p>
Songs: <select NAME="songs" SIZE=1>
<option VALUE="Liquid">Liquid</option>
<option VALUE="World's Apart">World's Apart</option>
<option VALUE="Ironic">Ironic</option>
<option VALUE="1979">1979</option>
<option VALUE="Wonderwall">Wonderwall</option>
<option VALUE="Standing Outside a Broken Phone Booth">
Standing Outside a Broken Phone Booth</option>
</SELECT><p>
<input type=button value="Show Current" onClick="quickSelect()">
</form>
</body>
</html>
|