<HTML>
<HEAD>
<TITLE>Extracting Highlighted Radio Button</TITLE>
<SCRIPT LANGUAGE="JavaScript">
function fullName() {
var form = document.forms[0]
for (var i = 0; i < form.songs.length; i++) {
if (form.songs[i].checked) {
break;
}
}
alert("You chose " + form.songs[i].value + ".")
}
</SCRIPT>
</HEAD>
<BODY>
<FORM>
<B>Select your favorite song:</B>
<INPUT TYPE="radio" NAME="songs" VALUE="A" CHECKED>A
<INPUT TYPE="radio" NAME="songs" VALUE="B" >B
<INPUT TYPE="radio" NAME="songs" VALUE="C" >C<BR>
<INPUT TYPE="button" NAME="Viewer" VALUE="View Full Name..." onClick="fullName()">
</FORM>
</BODY>
</HTML>
|