I need each line of checkboxes to compare their value to the string
above. And, if they match exactly I need " checked " written to them.

How do I do this? I tried INSTR but the problem is that if I have
<option type=checkbox value=45 name=theid> then it checkmarks that box
since the value 45 can be found in my string. But, they need to be exact
matches.

Advertisements

Joey Martin wrote on 03 mrt 2009 in
microsoft.public.inetserver.asp.general:
> I'll try to be as detailed as possible.
>
> I have a string:
>
> totalx="12345,5642,6610,3340"
>
> I have large list of check boxes. The value is being pulled from a
> database and dynamically generated.
>
> <option type=checkbox value=3333 name=theid>
> <option type=checkbox value=5642 name=theid>
> <option type=checkbox value=9001 name=theid>
>
> I need each line of checkboxes to compare their value to the string
> above. And, if they match exactly I need " checked " written to them.
>
> How do I do this? I tried INSTR but the problem is that if I have
> <option type=checkbox value=45 name=theid> then it checkmarks that box
> since the value 45 can be found in my string. But, they need to be exact
> matches.

add two commas to the sting:

totalx = "12345,5642,6610,3340"
s1 = "," & totalx & ","

and add them to the checkbox value too:

s2 = "," & myChkbxVal & ","

now do an instr() s2 in s1

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!