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

Checkboxes not update in asp database

P: 14
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
Share this Question
Share on Google+
4 Replies


Rabbit
Expert Mod 10K+
P: 12,370
It would help to see your code.
Oct 17 '12 #2

P: 14
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
Expert Mod 10K+
P: 12,370
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

P: 14
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.