logo
Ryan's Webpage
 

Music Chooser

Please tell me what music you like:

country
rock
rap
classical
blues

<html>
<head>
<script>
function processMusic(){
// by Ryan Te
// 10/30/07
// Music Chooser
// demonstrates check boxes

document.myForm.txtOutput.value = "";

if (document.myForm.chkCountry.checked == true){
document.myForm.txtOutput.value += "You like ";
document.myForm.txtOutput.value += document.myForm.chkCountry.value;
document.myForm.txtOutput.value += "\n";
} // end if

if (document.myForm.chkRock.checked == true){
document.myForm.txtOutput.value += "You like ";
document.myForm.txtOutput.value += document.myForm.chkRock.value;
document.myForm.txtOutput.value += "\n";
} // end if

if (document.myForm.chkRap.checked == true){
document.myForm.txtOutput.value += "You like ";
document.myForm.txtOutput.value += document.myForm.chkRap.value;
document.myForm.txtOutput.value += "\n";
} // end if

if (document.myForm.chkClassical.checked == true){
document.myForm.txtOutput.value += "You like ";
document.myForm.txtOutput.value += document.myForm.chkClassical.value;
document.myForm.txtOutput.value += "\n";
} // end if

if (document.myForm.chkBlues.checked == true){
document.myForm.txtOutput.value += "You like ";
document.myForm.txtOutput.value += document.myForm.chkBlues.value;
document.myForm.txtOutput.value += "\n";
} // end if

} // end processMusic

</script>
</head>
<body>
<center>
<h1>Music Chooser<hr></h1>
<form name = myForm>
<h3>Please tell me what music you like:</h3>
<table border = 0>
<tr>
<td><input type = "checkbox"
name = "chkCountry"
value = "country">country
</td>
</tr>

<tr>
<td><input type = "checkbox"
name = "chkRock"
value = "rock">rock
</td>
</tr>

<tr>
<td><input type = "checkbox"
name = "chkRap"
value = "rap">rap
</td>
</tr>

<tr>
<td><input type = "checkbox"
name = "chkClassical"
value = "classical">classical
</td>
</tr>

<tr>
<td><input type = "checkbox"
name = "chkBlues"
value = "blues">blues
</td>
</tr>

<tr>
<td><input type = "button"
value = "click me"
onClick = "processMusic()">
</td>
</tr>

</table>
<textarea name = "txtOutput"
rows = 30
cols = 35>
</textarea>
</form>
</center>
<hr>
</body>
</html>

 

 

Contact Me

 

Mr. Styner's Webpage

 

Peter

Julie

Nick

Tiddus

Norman