Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Multiple Checkboxes
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Multiple Checkboxes

 Post Reply Post Reply Page  <123>
Author
Gullanian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 04 January 2002
Location: England
Status: Offline
Points: 4373
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gullanian Quote  Post ReplyReply Direct Link To This Post Posted: 22 June 2003 at 4:46pm
<%
strDBField = "|"&Replace(rs("dbfield"),", ","|")&"|"
x=50
for i = 0 to x %>
<input type="checkbox" name="MyCheckBoxGroup" value="<%=i%>" <% if inStr(strDBField,"|"&i&"|")>0 then Response.Write " checked" end if %>> WRITE STUFF HERE
<%
next
%>

Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 22 June 2003 at 5:09pm
I would use an array to store the information like so:

<%
strDBField = "|"&Replace(rs("dbfield"),", ","|")&"|"
x=50
Dim arrCheckbox(50)
arrCheckbox(0) = "whatever goes here"
arrCheckbox(1) = "same as above"
.
.
.
.
arrCheckbox(49) = "stuff goes here"
arrCheckbox(50) = "check box stuff here too"

for i = 0 to x %>
<input type="checkbox" name="MyCheckBoxGroup" value="<%=i%>" <% if inStr(strDBField,"|"&i&"|")>0 then Response.Write " checked" end if %>>
<%=arrCheckbox(i)%>
<%
next
%>
Back to Top
faubo View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 May 2002
Location: Brazil
Status: Offline
Points: 560
Post Options Post Options   Thanks (0) Thanks(0)   Quote faubo Quote  Post ReplyReply Direct Link To This Post Posted: 22 June 2003 at 5:15pm

Thanks!!

the 5 option selectbox is working, I'm gonna try the one with 16 now!

 

Back to Top
faubo View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 May 2002
Location: Brazil
Status: Offline
Points: 560
Post Options Post Options   Thanks (0) Thanks(0)   Quote faubo Quote  Post ReplyReply Direct Link To This Post Posted: 22 June 2003 at 5:52pm

the 16th options are not working...

It checks the wrong boxes... I test marking 6 of the 2 digit optios (11 to 16)

and it's showing 3 options... 4, 5 and 6

I'm very tired of these damm boxes...

Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 22 June 2003 at 8:02pm
what is the value of the strDBField varable?
Back to Top
faubo View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 May 2002
Location: Brazil
Status: Offline
Points: 560
Post Options Post Options   Thanks (0) Thanks(0)   Quote faubo Quote  Post ReplyReply Direct Link To This Post Posted: 22 June 2003 at 10:33pm
strDBField = 11, 12, 13, 14, 15, 16
Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 24 June 2003 at 1:51pm
You need to go back and look at the code for multiple digit boxes posted above. You didn't change the strDBField line to :

strDBField = "|"&Replace(rs("dbfield"),", ","|")&"|"
Back to Top
faubo View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 May 2002
Location: Brazil
Status: Offline
Points: 560
Post Options Post Options   Thanks (0) Thanks(0)   Quote faubo Quote  Post ReplyReply Direct Link To This Post Posted: 25 June 2003 at 3:30pm

I hate to post code here but... I'm stuck at this...

strLanguages get's the data from a form.

strLanguages = "|"&Replace("strLanguages",", ","|")&"|"

x=16
Dim arrCheckbox(16)
arrCheckbox(0) = LanArabic
arrCheckbox(1) = LanCantonese
arrCheckbox(2) = LanDutch
arrCheckbox(3) = LanFarsi
arrCheckbox(4) = LanFinnish
arrCheckbox(5) = LanFrench
arrCheckbox(6) = LanGerman
arrCheckbox(7) = LanGreek
arrCheckbox(8) = LanHebrew
arrCheckbox(9) = LanItalian
arrCheckbox(10) = LanJapanese
arrCheckbox(11) = LanKorean
arrCheckbox(12) = LanPortuguese
arrCheckbox(13) = LanRussian
arrCheckbox(14) = LanSpanish
arrCheckbox(15) = LanSwedish

for i = 0 to x %>
            <td width="50%">

<input type="checkbox" name="languages" value="<%=i%>" <% if inStr(strSFeatures,"|"&i&"|")>0 then Response.Write " checked" end if %>><br>
              &nbsp;<span class="headingwhite"> 
              <% = arrCheckbox(i)%>
              <br><% next %>

Back to Top
 Post Reply Post Reply Page  <123>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.