I have a group of radio buttons. I cannot reference these individually unless I give them unique names. Not what I want to do.
If I reference the object using the following syntax, I get an error saying "object does not support property or method"
sValue = window.CriteriaPg.rState.value
If I use this syntax, I get this message "Expected end of statement" as the page is loaded
sValue = window.CriteriaPg.rState[0].value
Why cant I reference the individual radio buttons so I can read their value??
I also need to understand what the problem is as I need to be able to set the checked status of individual radio buttons.
HELP!!! - much appreciated
jan
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
<SCRIPT language="vbscript">
sub GetSchool()
sValue = window.CriteriaPg.rState[0].value 'or rState.value
msgbox sValue
end sub
</SCRIPT>
</HEAD>
<BODY >
<H1>Test Page</H1>
<FORM id=CriteriaPg>
<INPUT id=rState name=rState type=radio value=ACT checked>ACT
<INPUT id=rState name=rState type=radio value=NSW>NSW
</FORM>
<INPUT type="button" value="Button1" id=button1 name=button1 onclick="vbscript:call getschool()">
</BODY>
</HTML>
If I reference the object using the following syntax, I get an error saying "object does not support property or method"
sValue = window.CriteriaPg.rState.value
If I use this syntax, I get this message "Expected end of statement" as the page is loaded
sValue = window.CriteriaPg.rState[0].value
Why cant I reference the individual radio buttons so I can read their value??
I also need to understand what the problem is as I need to be able to set the checked status of individual radio buttons.
HELP!!! - much appreciated
jan
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
<SCRIPT language="vbscript">
sub GetSchool()
sValue = window.CriteriaPg.rState[0].value 'or rState.value
msgbox sValue
end sub
</SCRIPT>
</HEAD>
<BODY >
<H1>Test Page</H1>
<FORM id=CriteriaPg>
<INPUT id=rState name=rState type=radio value=ACT checked>ACT
<INPUT id=rState name=rState type=radio value=NSW>NSW
</FORM>
<INPUT type="button" value="Button1" id=button1 name=button1 onclick="vbscript:call getschool()">
</BODY>
</HTML>