Forums

This topic is locked

editing existing checkbox selections

Posted 28 May 2002 20:41:09
1
has voted
28 May 2002 20:41:09 Bob Vigen posted:
I have been strugling with this for a several days. I have a user profile where I use multiple checkboxes to define one or more categories the user may select.

I want the user to be able to edit this if chosen. But I cant get the checked checkboxes to show. I hope someone can give me a hand.

The system is build in the following way... The updatePage checkboxes are brought up dynamicaly from the database.

I use one recordset field (rsAdds("JAD_CATS" ) for bringing up the checkboxes and names. And another recordset field (rsCatsCheck("CAT_NAME" ) for the checked value. This last field contains the selected cats as text all in one field. I then use forllowing piece of code for the checbox:

<input type="checkbox" name="checkCat" value="<%=(rsCatsCheck.Fields.Item("CAT_NAME".Value)%> <% if rsAdds("JAD_CATS" = rsCatsCheck("CAT_NAME" then Response.Write "CHECKED"%>">

As I cant get it to work as is, I believe I would either have to form the SQL of the recordset diferently or adjust the way the selctted checkboxes are stored in the database.

Anyone know how?
Please help, thanks
Bob

Replies

Replied 29 May 2002 13:02:29
29 May 2002 13:02:29 ed p replied:
i had the same problem, i got round it using a different approach.
i only had 1 checkbox though so it was easier than if you have multiple boxes.
i just put 2 boxes on the page, 1 checked , 1 not.
the appropriate checkboxes were hidden/displayed depending on the value of the database checkbox.
not the best solution im sure , especially with multiple checkboxes, interested if anybody can come up with any other ideas.
<img src=../images/dmxzone/forum/icon_smile_blush.gif border=0 align=middle>

Reply to this topic