troubleshooting Question

build a dynamic list of checkboxes based on one table with selected set from another

Avatar of chipsterva69
chipsterva69 asked on
Microsoft SQL ServerASPVB Script
18 Comments1 Solution513 ViewsLast Modified:
I have been tasked with creating a page that allows logged in users to view a list of  job options attached to their record and if they wish, uncheck items and check others, then submit the list.

We use ASP VB.script pages and are pulling data from a proprietary AMS system.

The items making up the list (40 options, in this case) come from one table in the database (we'll call it tbl_codes), with the data in the table being option ID, option description and some other fields.  What users have selected are kept in another table (we'll call this tbl_codes_select), with the data in the table being a row ID, a user ID, and a option ID (nvarchar, 16 characters for some reason), along with some other fields.

What I would like to put together is some kind of code that dynamically reads the option table and generates a list of check boxes, one for each option, with the correct checkboxes checked based on the info in the codes_select table.

I initially put together a static table with each radio box dynamically checking it's corollary field in the codes_select table, but then it occurred to me that this will get very cumbersome as we add other options at a later date (I was also stumped by a single user having multiple options), so I began thinking of an array, but I have no clue how to put one together for this particular project.

The second half of this (to be asked once this part is solved to try to max out the points) is once the checkbox list is displayed, how do I craft the update statement?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 18 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 18 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros