468,505 Members | 1,669 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,505 developers. It's quick & easy.

Checkboxes not update in asp database

I have a list of checkboxes like 1,2,3,4,5 when I use update statement I get 1 instead of 1,2,3,4,5 in my database column. I have checked to make sure request.form is returning 1,2,3,4,5 and it is but it only update one value instead of the array of numbers. Is there a simple way to get this to update correctly? Thanks for your help in advance.
Oct 17 '12 #1
4 1668
Rabbit
12,513 Expert Mod 8TB
It would help to see your code.
Oct 17 '12 #2
Update statement

Expand|Select|Wrap|Line Numbers
  1. NMGroups = Request.Form("NMGroups")
  2.  
  3. strSQL = "UPDATE NewsletterMembers set NMGroups = '" & NMGroups & "' WHERE NMID =" & NMID
  4.  
checkboxes are all name NMGroups with value of 1,2,3,4 etc

I just need the array of numbers to update to one table called NMGroups in my database. Right now it works in my insert statement but when I us the update statement it only grabs the first number in the array. How do I grad all numbers like 1,2,3,4 and save it.
Oct 17 '12 #3
Rabbit
12,513 Expert Mod 8TB
Append the different elements into one string. But I don't recommend doing this. It will work but your data will be denormalized and make future querying more difficult.
Oct 18 '12 #4
fixed it I forgot to remove the whitespace used replace(request.form("NMGroups"), " ", "") 1, 2, 3, 4 almost looks like1,2,3,4 when I did the response.write to verify the form.
Oct 19 '12 #5

Post your reply

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

Similar topics

5 posts views Thread by Leanne | last post: by
6 posts views Thread by Tark Siala | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.