Skip to main content
Known Participant
August 23, 2008
Question

Help - what is the command

  • August 23, 2008
  • 1 reply
  • 229 views
I dynamically generate textboxes, so they all have the same name. There are ten boxes in all. I know it outputs the checked boxes in a comma deliminted string, 1,2,3,4....etc. If checkbox 4 was one of the boxes selected, I need to do a cflocation to redirect to another. I was using cfif checkbox_id = "4" but that only works if that was the only box selected.

If the other boxes were seleced in addition to box 4, the ciffi does not work, so what is the proper command to check if 4 is in the list ?

For the life of me, I cannot remember and I know I have done it before. I know sql query is in (1,2,3....), but what is the cf command ?

Thanks
    This topic has been closed for replies.

    1 reply

    Inspiring
    August 23, 2008
    <cfset boxes="4,5,7">

    <cfif listfind( boxes, "1" ) GT 0>
    found3
    </cfif>


    Known Participant
    August 23, 2008
    Hi Fober1, thanks for the reply

    <cfset boxes="4,5,7">

    <cfif listfind( boxes, "1" ) GT 0>
    found3
    </cfif>

    Boxes contains the list of the values of the checkboxes that were checked, and listfind finds if the first checkbox, value 1 is in the list, which means it was checked. and GT 0 means that it was found/in the list ?