SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old March 28th, 2002, 04:27 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 23
Multiple checkbox values displayed in checkboxes.

<i><b>Originally posted by : Eric Preston (ericpreston@email.com)</b></i><br />I have a form that sends info to a database. One field is populated useing a few checkboxes.<br /><br />EX:<br /><br /><input type="checkbox" name="same" value="value1"><br /><input type="checkbox" name="same" value="value2"><br /><input type="checkbox" name="same" value="value3"><br /><input type="checkbox" name="same" value="value4"><br /><br />So the database's field could read: <br />"value1, value3"<br /><br />What I would like to do is query the database on a different form with checkboxes then show the values entered as already checked.<br /><br />When it's one value I have no problem displying it, just set the one that's value mtches as 'checked'.<br /><br />The problem is query the DB to set out which ones were chosen when multiple ones are chosen.<br /><br />Any ideas?

Reply With Quote
  #2  
Old March 28th, 2002, 07:50 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 23
<i><b>Originally posted by : Eric Preston (ericpreston@email.com)</b></i><br />Forget it, I figured it out.<br /><br />Dim arrFromDB, arrCheckBox(3), y, z, w<br /><br />arrFromDB = Split(objRSAll("CQuoteAvail"),", ")<br /><br />arrCheckBox(0) = "Asia/Pacific"<br />arrCheckBox(1) = "Canada"<br />arrCheckBox(2) = "Europe"<br />arrCheckBox(3) = "US"<br /><br />x=0<br />y=0<br />z=UBound(arrCheckBox)<br />w=UBound(arrFromDB)<br />Do While x < (z + 1)<br />y=0<br /> Do While y < (w + 1)<br /> If arrCheckBox(x) = arrFromDB(y) Then<br /> Response.Write "<input checked type='checkbox' name='CQuoteAvail' value='"&arrCheckBox(x)&"' tabindex='1'> "&arrCheckBox(x)&"<br />"&vbcrlf<br /> y=y+(w + 1)<br /> Else<br /> If y=w Then<br /> Response.Write "<input type='checkbox' name='CQuoteAvail' value='"&arrCheckBox(x)&"' tabindex='1'> "&arrCheckBox(x)&"<br />"&vbcrlf<br /> End If<br /> y=y+1<br /> End If<br /> Loop<br />x=x+1<br />Loop<br /><br /><br />------------<br />Eric Preston at 3/28/2002 1:27:06 PM<br /><br />I have a form that sends info to a database. One field is populated useing a few checkboxes.<br /><br />EX:<br /><br /><input type="checkbox" name="same" value="value1"><br /><input type="checkbox" name="same" value="value2"><br /><input type="checkbox" name="same" value="value3"><br /><input type="checkbox" name="same" value="value4"><br /><br />So the database's field could read: <br />"value1, value3"<br /><br />What I would like to do is query the database on a different form with checkboxes then show the values entered as already checked.<br /><br />When it's one value I have no problem displying it, just set the one that's value mtches as 'checked'.<br /><br />The problem is query the DB to set out which ones were chosen when multiple ones are chosen.<br /><br />Any ideas?

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > Multiple checkbox values displayed in checkboxes.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT