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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Radio Button Vaildation Problem

Status
Not open for further replies.

davefm1

Programmer
Apr 18, 2001
78
US
HI
I'm trying to call the functions below from my run button to check if my select and a radio option have been selected if not sent A msg box.

I keep getting does't support this method or proprty error message does any one kow what i'm doing wrong.
I would apperacate you input.

Thanks
Dave




function ChoiceValidater(radGroup)
dim i
ChoiceValidater=false
'loop through radio buttons to see if checked
for i=0 to radGroup.lenght-1
'if one is checked we have a valid option
If radgroup(i).checked =true then ChoiceValidater=true
next
end function
'*****************************************************************************
function CheckForm()
' check if a platformand option have been chosen
dim svaildity
If report_name<>&quot;&quot; and ChoiceValidater(form1.reportRadio)=true then
form1.submit
else
if report_name=&quot;&quot; and ChoiceValidater(form1.reportRadio)=false then
Msgbox=(&quot;You must select a platforn and a option to run a report.&quot;)
else
if report_name<>&quot;&quot; and ChoiceValidater(form1.reportRadio)=false then
Msgbox=(&quot;You Must also select an option to run a report.&quot;)
else
if report_name=&quot;&quot; and ChoiceValidater(form1.reportRadio)=true then
Msgbox=(&quot;You Must also select a report to run a report.&quot;)
end if
end if
end if
end if
end function

'***********here's the select and radi button group*********
<form name=&quot;form1&quot; id=form1 action=&quot;&quot; method=&quot;post&quot;>
<div align=&quot;center&quot;>
<table border=&quot;1&quot; cols=&quot;4&quot; width=&quot;60%&quot;>
<tr style=&quot;cols:4&quot;>
<th width=&quot;20%&quot; colspan=&quot;2&quot; ><strong>Select Plateform:</strong></th>
<td width=&quot;40%&quot; colspan=&quot;2&quot; >
<select style=&quot;type:text&quot; size=&quot;width:55&quot; name=&quot;report_name&quot; style=&quot;font-family:monospace&quot;>
<option style=&quot;font-family:monospace&quot; value=&quot;<%'= rs1(&quot;report_name&quot;)%>&quot;
<% if rs1(&quot;report_name&quot;)= request(&quot;report_name&quot;)then
%>SELECTED<%
end if
%>
>
<%
Response.Write (rs1(&quot;report_name&quot;))
rs1.MoveNext()
%>
</option>
<%loop %>
</select>
</td>
</tr>
</table>
<!-- option to run report-->
<table border=&quot;1&quot; cols=&quot;4&quot; width=&quot;60%&quot;>
<tr align=&quot;left&quot; colspan=4&quot;>
<th align=&quot;left&quot; width=&quot;60%&quot; colspan=&quot;4&quot; style=&quot;font-family:monospace&quot;>   <input type=&quot;radio&quot; id= &quot;reportRadio&quot; name=&quot;reportRadio&quot; value=&quot;A&quot; /><strong>Select Monthly:</strong>
</th>
</tr>
<tr align=&quot;left&quot; colspan=4&quot;>
<th align=&quot;left&quot; width=&quot;60%&quot; colspan=&quot;4&quot; style=&quot;font-family:monospace&quot;>   <input type=&quot;radio&quot; id= &quot;reportRadio&quot; name=&quot;reportRadio&quot; value=&quot;B&quot; /><strong>Select Monthly:</strong>
</th>
</tr>
<tr align=&quot;left&quot; colspan=4&quot;>
<th align=&quot;left&quot; width=&quot;60%&quot; colspan=&quot;4&quot; style=&quot;font-family:monospace&quot;>   <input type=&quot;radio&quot; id= &quot;reportRadio&quot; name=&quot;reportRadio&quot; value=&quot;C&quot; /><strong>Select Yearly:</strong>
</th>
</tr>
</table>
</div>
<br/>
<br/>
<br/>
<br/>
'******************button that suppouse to check if selected******************
<div align=&quot;center&quot;>
<table width=&quot;100%&quot; align=&quot;center&quot; cols=&quot;1&quot; border=&quot;0&quot;>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr align=&quot;center&quot;>
<td>
<input alt=&quot;Run Report&quot; type=&quot;button&quot; value=&quot;RUN&quot;style=&quot;height:22px; width:173px;&quot; id=&quot;CheckForm&quot; name=&quot;CheckForm&quot; onclick=&quot;CheckForm()&quot;/>
</td>
</tr>
</table>
</div>
</form>
 
davefm1,

You have a mispelling..

for i=0 to radGroup.lenght-1

Should be

for i=0 to radGroup.length-1


fengshui_1998
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top