Form Radio Buttons in VBScript


Please choose your favorite color
White
Red
Green
Blue
Magenta
Yellow
Purple

<BODY>
<SCRIPT LANGUAGE="VBSCRIPT">
<!--
	Sub Button1_onclick
		Dim x
		
		For x = 0 to 6
			If Form1.elements(x).checked = True Then
				document.bgColor = Form1.elements(x).value
			End If
		Next 
	End Sub
-->
</SCRIPT>

<FORM NAME="Form1"><B>Please choose your favorite color</B>
	<BR><INPUT TYPE=RADIO NAME="rdoColor" VALUE="White" CHECKED> White
	<BR><INPUT TYPE=RADIO NAME="rdoColor" VALUE="Red"> Red
	<BR><INPUT TYPE=RADIO NAME="rdoColor" VALUE="Green"> Green
	<BR><INPUT TYPE=RADIO NAME="rdoColor" VALUE="Blue"> Blue
	<BR><INPUT TYPE=RADIO NAME="rdoColor" VALUE="Magenta"> Magenta
	<BR><INPUT TYPE=RADIO NAME="rdoColor" VALUE="Yellow"> Yellow
	<BR><INPUT TYPE=RADIO NAME="rdoColor" VALUE="Purple"> Purple
	<BR><INPUT TYPE=BUTTON NAME="Button1" VALUE="Ready">
</FORM>