I’m trying to report the values of the radio button called flavor,
I must show on a new page the name of the radio button, the value of each radio button, the radio button that was checked at load time and the radio button checked by the user. I tried using a for with 3 if statements for check, not check or default check but it didnt work so i did 2 functions 1 for check and the other for defaultcheck, the problem is just one function works and the other one gives me an error. I would appreciate help.
Thank you!
I show the HTML now thanx Khalil
HTML>
<HEAD>
<TITLE>Ice Cream Shop Order Form
</TITLE>
<SCRIPT LANGUAGE= “JavaScript”>
<!—
function radioCheck()
{
var counter;
for (counter=0; counter<5; counter++)
{
if (document.form1.flavor[counter].checked)
{
document.write (document.form1.flavor[counter].value);
document.write (” “);
document.write (“Checked by User”);
}
}
}
function radioDefault()
{
var count;
for (count=0; count<5; count++)
{
if (document.form1.flavor[count].defaultChecked)
{
document.write (document.form1.flavor[count].value);
document.write (” “);
document.write (“Checked at load time”);
}
}
}
function edit()
{
radioCheck ();
radioDefault();
}
—>
// I call the function edit here
<INPUT TYPE= “button” VALUE= “Edit and Report” NAME= “butcheck” onclick=”edit()”>
</FORM>
</BODY>
</HTML>