
March 28th, 2002, 07:50 PM
|
|
Contributing User
|
|
Join Date: Dec 2002
Posts: 14,575
  
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?
|