I need to make sure there is information contained within various flavors of inputs. I already have the Dropdown and textboxes working, but I can't get the radio buttons and check boxes.
I want to make sure they are checked. How do I go about doing that. Below is my validation routine and my actual input boxes. Thanks.
I want to make sure they are checked. How do I go about doing that. Below is my validation routine and my actual input boxes. Thanks.
Code:
Sub ChkSubmit(nquestions)
dim results, i,DEname,DEvalue,DEtype,iLoop
i = 0
'results = msgbox("Hello "& nquestions)
Do while i <= nquestions
DEtype = document.frmDemogFormsAction.elements(i).type
DEname = document.frmDemogFormsAction.elements(i).name
DEvalue = document.frmDemogFormsAction.elements(i).value
results = msgbox("Please enter information for "& DEvalue & " : " &DEname & " : " & DEtype)
Select case DEtype
Case "select-one"
If cdbl(DEvalue) = -1 then
results = msgbox("Please enter information for "& DEname)
'document.frmDemogFormsAction.elements(i).focus
'exit sub
End if
case "radio"
' For iLoop = 0 to 1
' If document.frmDemogFormsAction.radio(iLoop).checked = True Then
' results = msgbox("Please enter information for "& DEvalue & " " &DEname)
' Exit For
' End If
' Next
case "text"
If DEvalue = "" then
results = msgbox("Please enter information for "& DEname)
'document.frmDemogFormsAction.elements(i).focus
'exit sub
End if
case "checkbox"
If DEvalue = off then
results = msgbox("Please enter information for "& DEname)
'document.frmDemogFormsAction.elements(i).focus
'exit sub
End if
end select
'If cdbl(DEvalue) = -1 or DEvalue = "" then
'document.frmDemogFormsAction.elements(i).focus
'exit sub
'End if
i = i + 1
loop
End Sub
Case "Checkbox"
'//Inserts a Checkbox if the Response type is "Checkbox"
%><input type=checkbox name=<%=rsGQ.Fields("VC_FORM_FIELD_NAME")%>> <%=rsGA.Fields("VC_ANSWER_TEXT")%><%
Case "radio"
'//Inserts a set of Radio Buttons if the Response type is "radio"
%><input type=radio name=<%=rsGQ.Fields("VC_FORM_FIELD_NAME")%> value=1><%=rsGA.Fields("VC_ANSWER_TEXT")%>
<%rsGA.MoveNext%>
<input type=radio name=<%=rsGQ.Fields("VC_FORM_FIELD_NAME")%> value=2><%=rsGA.Fields("VC_ANSWER_TEXT")%><%