Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

radio button 1

Status
Not open for further replies.

HomerJS

Programmer
Jun 25, 2001
86
US
Below is code I'm working on in InterDev. When I click the submit button I get the following error message: Object doesn't support this property or method: 'document.frmByCust.radDate.value'
What can I do to fix this?

<HEAD>
<title>Customer Report</title>
<META NAME=&quot;GENERATOR&quot; Content=&quot;Microsoft Visual Studio 6.0&quot;>
<SCRIPT LANGUAGE=&quot;VBScript&quot;>
<!-- Option Explicit

function frmByCust_onsubmit()
msgbox &quot;radDateIndx: &quot; & document.frmByCust.radDate.value
end function

-->
</SCRIPT>
</HEAD>

<BODY text=Black language = vbscript bgproperties=&quot;fixed&quot;>
<form action=&quot;ByCust2.asp&quot; method=&quot;post&quot; id=&quot;frmByCust&quot; name=&quot;frmByCust&quot; language=vbscript>
<input type=&quot;radio&quot; name=&quot;radDate&quot; value=&quot;RecDate&quot; tabindex=1 checked>Record Date
<input type=&quot;radio&quot; name=&quot;radDate&quot; value=&quot;LoadDate&quot; tabindex=2>Revenue Date
<br>
<input type=&quot;submit&quot; value=&quot;Submit&quot; id=&quot;submitInfo&quot; tabindex=3 name=submitInfo>   
<input type=&quot;reset&quot; value=&quot;Reset&quot; id=&quot;ResetInfo&quot; tabindex=4>
</form>
</BODY>
</HTML>

 
You have to use the index of the radio button (works also for checkboxes)

Code:
function frmByCust_onsubmit()
    Dim sValue: sValue = &quot;&quot;
    If document.frmByCust.radDate(0).checked Then
    	sValue = document.frmByCust.radDate(0).value
    Else
    	sValue = document.frmByCust.radDate(1).value
    End If
    
    msgbox &quot;radDateIndx: &quot; & sValue
end function

Hope it helps, Rob
robschultz@yahoo.com
-Focus on the solution to the problem, not the obstacles in the way.-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top