<html>
<head>
<title>Abakada HTML Demo: input type=radio Example</title>
<link rel="stylesheet" href="/abkd/shared/museo.css">
<style>
.options {
width: 50%; padding: 20; background: #246;
}
</style>
<script language="JavaScript">
<!--
var check = new Array ( );
check [ 0 ] = "Abraham Lincoln came a tad bit later";
check [ 1 ] = "Christopher Columbus was an explorer, \nnot a United States President.";
check [ 2 ] = "Correct. George Washington was the \nfirst President of the United States of America.";
check [ 3 ] = "Robert Plant was the lead vocalist of Led Zeppelin, \nnot a United States President.";
function chkAnswer ( ) {
for ( var i = 0; i < document.theForm.choices.length; i ++ ) {
if ( document.theForm.choices [ i ].checked ) {
alert ( check [ i ] );
}
}
}
//-->
</script>
</head>
<body>
<div class="header"><h2>Abakada HTML Demo: <b>input type=radio</b> Example</h2></div><hr size=1 width=92%>
<center>
<h4>This example shows how client-side script may be used<br>
to detect which radiobuttons are selected from multiple choices.</h4>
<p id="msg"><b>The first president of the United States was: </b></p>
<div class="options">
<form name=theForm>
<table align="center">
<tbody>
<tr>
<td><label for=oradio1>Abraham Lincoln</label></td>
<td><input id=oradio1 name=choices type=radio onclick="chkAnswer ( )"></td></tr>
<tr>
<td><label for=oradio2>Christopher Columbus</label></td>
<td><input id=oradio2 name=choices type=radio onclick="chkAnswer ( )"></td></tr>
<tr>
<td><label for=oradio3>George Washington</label></td>
<td><input id=oradio3 name=choices type=radio onclick="chkAnswer ( )"></td></tr>
<tr>
<td><label for=oradio4>Robert Plant</label></td>
<td><input id=oradio4 name=choices type=radio onclick="chkAnswer ( )"></td></tr>
</tbody>
</table>
<br>
<input type=reset>
</form>
</div>
</center>
<hr size=1 width=92%>
<!-- #include virtual="~/shared/viewsrc.inc" -->
</body>
</html>