This is a Classic ASP question concerning using VBScript on the Server Side to return the value of a Checkbox.
I have a form that creates checkboxes in VBScript code then the page is first rendered. I create a variable number of checkboxes in a do loop (see code)
Essentially the code generates a dynamic number of checkboxes each with a different name, id, & value. The value is the ID of a table into which I want to save true/false based on whether the checkbox is checked. The checkboxes appear to be generated correctly.
Then I post the form in which the checkboxes r located. I'm able to read values of text boxes using VBScript on Server.
HOWEVER, when I attempt to read the checkboxes on the Server Side using VBScript to process the value of the checkbox. I use code like
myVal = Request.Form(strCbxName) .... where strCBXName = "cbx1', "cbx2" ....
Regardless of the state of the checkbox, I cannot seem to get a value or checked status from the checkbox.
Any thoughts on what is happening?
Thanks for your help
mynum = 0
Do while not rst1.EOF
mynum = mynum + 1
<input type="Checkbox" name="<%='cbx' & mynum%> id = <%='cbx' & mynum%> value = <% rst1.fields('value') >