Help - what is the command

This is a discussion on Help - what is the command within the Cold Fusion forums in Application Servers & Tools category; 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 ...

Go Back   Application Development Forum > Application Servers & Tools > Cold Fusion

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-22-2008, 09:46 PM
Olivia Crazy Horse
Guest
 
Default Help - what is the command

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

Reply With Quote
  #2  
Old 08-22-2008, 10:03 PM
fober1
Guest
 
Default Re: Help - what is the command

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

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



Reply With Quote
  #3  
Old 08-23-2008, 12:13 AM
Olivia Crazy Horse
Guest
 
Default Re: Help - what is the command

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 ?

Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 06:16 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.