General discussion
Thread display: Collapse - |
All Comments
Start or search
Create a new discussion
If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.
VBScript dynamic Select Case
DO UNTIL rs2.eof
If rs2(fieldname) = "ALL" then
str = str & "CASE " & x & vbCrLF & "document.formname.fieldname" & x & "." & y & ".1.checked = false" & vbCrLf
Else
stra = stra & "CASE " & x & vbCrLf & "document.formname.fieldname" & x & "." & y & ".1.checked = false" & vbCrLf
End If
<input type=checkbox name=fieldname value=<%=rs2(fieldname)%> onclick="verify 'trim(rs2(fieldname))', <%=x%>">
rs2.movenext
LOOP
later in the page:
<input type=hidden name=str value=<%=str%>>
<input type=hidden name=stra value=<%=stra%>>
end of page:
<SCRIPT LANGUAGE=VBScript>
Sub verify(this, scase)
rsp = CStr(this)
selcase = CInt(scase)
If rsp = "ALL" then
execute (document.formname.str.value)
Else
execute (document.formname.stra.value)
End If
End Sub
</SCRIPT>
However, I need it to run only the appropriate select case items. The textbox str would have something like:
CASE 0
document.formname.fieldname0.1.1.checked = false
CASE 0
document.formname.fieldname0.2.1.checked = false
CASE 1
document.formname.fieldname1.1.1.checked = false
CASE 1
document.formname.fieldname1.1.1.checked = false
...etc.
How would I get the VBScript sub to execute only those items in Case 0? or Case 1? etc???
Your help is GREATLY appreciated. Thank you!
Regards,
Cora