K
kim
Please explain the following
<SCRIPT>
var aRadio1Answers=new Array("Correct. George Washington was the first
President of the United States of America.","Abraham Lincoln came a
tad bit later","Christopher Columbus was an explorer, not a United
States President.","Robert Plant was a singer with Led Zeppelin, not a
United States President.");
function fnGetAnswer(){
for(var i=0;i<Form1.radio1.length;i++){
if(Form1.radio1(i).checked){
alert(aRadio1Answers);
What is var i = 0;<Form1.radio1.length;i++)
Now remember I have no programming experince. I understand the if and
alert.
Where did (i) come from and how do you know which button has been
checked
<TABLE>
<TR><TD><LABEL FOR=oRadio1>George Washington</LABEL></td><td><INPUT
TYPE=radio NAME="radio1" ID="oRadio1"></TD></TR>
<TR><TD><LABEL FOR=oRadio2>Abraham Lincoln</LABEL></TD><TD><INPUT
TYPE=radio NAME="radio1" ID="oRadio2"></TD></TR>
<TR><TD><LABEL FOR=oRadio3>Christopher Columbus</LABEL></TD><TD><INPUT
TYPE=radio NAME="radio1" ID="oRadio3"></TD></TR>
<TR><TD><LABEL FOR=oRadio4>Robert Plant</LABEL></TD><TD><INPUT
TYPE=radio NAME="radio1" ID="oRadio4"></TD></TR>
</TABLE>
<P>
<INPUT TYPE=button VALUE="Check Answer" onclick="fnGetAnswer()">
<SCRIPT>
var aRadio1Answers=new Array("Correct. George Washington was the first
President of the United States of America.","Abraham Lincoln came a
tad bit later","Christopher Columbus was an explorer, not a United
States President.","Robert Plant was a singer with Led Zeppelin, not a
United States President.");
function fnGetAnswer(){
for(var i=0;i<Form1.radio1.length;i++){
if(Form1.radio1(i).checked){
alert(aRadio1Answers);
What is var i = 0;<Form1.radio1.length;i++)
Now remember I have no programming experince. I understand the if and
alert.
Where did (i) come from and how do you know which button has been
checked
<TABLE>
<TR><TD><LABEL FOR=oRadio1>George Washington</LABEL></td><td><INPUT
TYPE=radio NAME="radio1" ID="oRadio1"></TD></TR>
<TR><TD><LABEL FOR=oRadio2>Abraham Lincoln</LABEL></TD><TD><INPUT
TYPE=radio NAME="radio1" ID="oRadio2"></TD></TR>
<TR><TD><LABEL FOR=oRadio3>Christopher Columbus</LABEL></TD><TD><INPUT
TYPE=radio NAME="radio1" ID="oRadio3"></TD></TR>
<TR><TD><LABEL FOR=oRadio4>Robert Plant</LABEL></TD><TD><INPUT
TYPE=radio NAME="radio1" ID="oRadio4"></TD></TR>
</TABLE>
<P>
<INPUT TYPE=button VALUE="Check Answer" onclick="fnGetAnswer()">