By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,867 Members | 1,964 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,867 IT Pros & Developers. It's quick & easy.

Dynamic Checkbox Array Input Not Returning

P: 1
I have a potentially large number of checkboxes that I need to get input from. I have a table in a SQL database that has a list of names that I need to pull out, give 4 checkbox inputs for each of them, then put all the new data into a new database.

Currently I have:
Expand|Select|Wrap|Line Numbers
  1. <%
  2. Set Conn = Server.CreateObject("ADODB.Connection")
  3. "--connection information here--"
  4. SQL = "Select firstname,lastname from [names] order by lastname"
  5. Set RS = Conn.Execute(SQL)
  6. %> 
  7. <table border=1>
  8.   <tr>
  9.     <th>Name</th>
  10.     <th>Condition One</th>
  11.     <th>Condition Two</th>
  12.     <th>Condition Three</th>
  13.     <th>Condition Four</th>
  14.   </tr>
  15.   <%
  16.     Do While Not RS.EOF
  17.   %>
  18.   <tr>
  19.     <td><%=RS("LastName")%>, <%=RS("FirstName")%></td>
  20.     <td><input type="checkbox" name="input1"></td>
  21.     <td><input type="checkbox" name="input2"></td>
  22.     <td><input type="checkbox" name="input3"></td>
  23.     <td><input type="checkbox" name="input4"></td>
  24.   </tr>
  25.   <%
  26.     RS.MoveNext
  27.     Loop
  28.   %>
  29. </table>
This builds the table in the way I want but when I later go back and get the information from this table I run into a problem.
"Request.Form("input1")" only retrieves the value "on" from the boxes that are checked and nothing from those that are not checked.

How can I get a "false" or "off" value from the ones that are not checked so I can put the collected data into the new table in a [name, val1, val2, val3, val4] kind of format.
Jun 10 '14 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.