• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 204
  • Last Modified:

Control Array

I want to use an  array of check boxes and read the checked items in VB Script and J-Script. How can i do that. I have the code , it is creating check boxes. But i cannot read  the values  in Java Script and VB Script.
set conn = server.CreateObject("adodb.connection")
conn.open "DSN=test;"
sqlstr = "select * from CheckBox "
 set rs = conn.Execute(sqlstr)
 i = 1
 while not rs.eof  
  CheckBoxStr = CheckBoxStr &"<INPUT id=chkType  name= chkType"
   CheckBoxStr = CheckBoxStr & "  type=checkbox value = " & rs("id")
   CheckBoxStr = CheckBoxStr & " > " &  rs("Text")
   i = i + 1
Response.Write CheckBoxStr
1 Solution
<%@ Language=VBScript %>
Response.Write Request.form("chkType")

This will output values of all the selected checkboxes.

basically use Request.form("chkType") to access the variables when submiting a form using the post and Request.querystring("chkType") when submitting the form using the get (the default).

Hope this helps :-)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now