Re: [ cf-dev ] Slect Multiple
Russ Michaels (Snake) wrote: Put the selected sizes in a list, and then when you loop over the query to create the selectlist options, check if each value is in the list. E.G cfset selectedItems = Valuelist(GetItemSizes.FKSizeIF) select multiple name=ModifiedSize cfoutput query=GetSizes option value=#GetSizes.SizeID# #IIF(Listcontains(SelectedItems, SizeID), DE('selected'),DE(''))##GetSizes.Size#/option /cfoutput /select #IIF(ListFind(SelectedItems, SizeID),DE('selected'),DE(''))# Use listfind, not listcontains. Otherwise you could end up in a whole world of pain. ;o) Stephen -- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ CFDeveloper Sponsors and contributors:- *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com* *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com* To unsubscribe, e-mail: [EMAIL PROTECTED]
RE: [ cf-dev ] Slect Multiple
Wouldn't this do the trick... select multiple name=ModifiedSize cfoutput query=GetSizes cfif SizeID eq GetItemsizes.FKSizeID option value=#SizeID# selected=selected#Size#/option /cfif option value=#SizeID##Size#/option /cfoutput /select And it's certainly better performance wise to use a normal cfif over IIF. Andy Quoting Russ Michaels (Snake) [EMAIL PROTECTED]: Put the selected sizes in a list, and then when you loop over the query to create the selectlist options, check if each value is in the list. E.G cfset selectedItems = Valuelist(GetItemSizes.FKSizeIF) select multiple name=ModifiedSize cfoutput query=GetSizes option value=#GetSizes.SizeID# #IIF(Listcontains(SelectedItems, SizeID), DE('selected'),DE(''))##GetSizes.Size#/option /cfoutput /select Russ -Original Message- From: Paul Swingewood [mailto:[EMAIL PROTECTED] Sent: 19 September 2004 21:11 To: [EMAIL PROTECTED] Subject: [ cf-dev ] Slect Multiple I have a modify form. I want to show the multiple values of a select that were cosen when the user entered the data. I have this !--- This query gets those sizes that were selected --- cfquery name=GetItemSizes datasource=#application.dsn# SELECT FKSizeID, FKItemID FROM tblItemSizes WHERE (FKItemID = #url.ItemID#) /cfquery !--- This query gets all possible sizes -- cfquery name=GetSizes datasource=#application.dsn# SELECT SizeID, Size FROM tblSizes WHERE 0=0 ORDER BY size ASC /cfquery Ok now show the selection ... tr td valign=topSize :/td td valign=top select multiple name=ModifiedSize cfoutput query=GetSizes cfif GetSizes.SizeID eq #GetItemsizes.FKSizeID# option value=#SizeID# selected#GetSizes.Size#/option cfelse option value=#GetSizes.SizeID##GetSizes.Size#/option /cfif /cfoutput /select /td /tr The thing is this shows only one selection :-( How do I loop coorectly to show all of the previous selections? Regards - Paul -- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ CFDeveloper Sponsors and contributors:- *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com* *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com* To unsubscribe, e-mail: [EMAIL PROTECTED] -- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ CFDeveloper Sponsors and contributors:- *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com* *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com* To unsubscribe, e-mail: [EMAIL PROTECTED] -- [EMAIL PROTECTED] www.creative-restraint.co.uk -- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ CFDeveloper Sponsors and contributors:- *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com* *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com* To unsubscribe, e-mail: [EMAIL PROTECTED]
Re: [ cf-dev ] Slect Multiple
Thanks for that guys. It makes sense and seems to work all ok... Regards - Paul From: Stephen Moretti (cfmaster) [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: [ cf-dev ] Slect Multiple Date: Mon, 20 Sep 2004 07:39:41 +0100 Russ Michaels (Snake) wrote: Put the selected sizes in a list, and then when you loop over the query to create the selectlist options, check if each value is in the list. E.G cfset selectedItems = Valuelist(GetItemSizes.FKSizeIF) select multiple name=ModifiedSize cfoutput query=GetSizes option value=#GetSizes.SizeID# #IIF(Listcontains(SelectedItems, SizeID), DE('selected'),DE(''))##GetSizes.Size#/option /cfoutput /select #IIF(ListFind(SelectedItems, SizeID),DE('selected'),DE(''))# Use listfind, not listcontains. Otherwise you could end up in a whole world of pain. ;o) Stephen -- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ CFDeveloper Sponsors and contributors:- *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com* *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com* To unsubscribe, e-mail: [EMAIL PROTECTED] -- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ CFDeveloper Sponsors and contributors:- *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com* *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com* To unsubscribe, e-mail: [EMAIL PROTECTED]
RE: [ cf-dev ] Slect Multiple
Ar$e ... I missed the 'multiple' in the select - it's Monday morning :) Andy Quoting Andy Allan [EMAIL PROTECTED]: Wouldn't this do the trick... select multiple name=ModifiedSize cfoutput query=GetSizes cfif SizeID eq GetItemsizes.FKSizeID option value=#SizeID# selected=selected#Size#/option /cfif option value=#SizeID##Size#/option /cfoutput /select And it's certainly better performance wise to use a normal cfif over IIF. Andy Quoting Russ Michaels (Snake) [EMAIL PROTECTED]: Put the selected sizes in a list, and then when you loop over the query to create the selectlist options, check if each value is in the list. E.G cfset selectedItems = Valuelist(GetItemSizes.FKSizeIF) select multiple name=ModifiedSize cfoutput query=GetSizes option value=#GetSizes.SizeID# #IIF(Listcontains(SelectedItems, SizeID), DE('selected'),DE(''))##GetSizes.Size#/option /cfoutput /select Russ -Original Message- From: Paul Swingewood [mailto:[EMAIL PROTECTED] Sent: 19 September 2004 21:11 To: [EMAIL PROTECTED] Subject: [ cf-dev ] Slect Multiple I have a modify form. I want to show the multiple values of a select that were cosen when the user entered the data. I have this !--- This query gets those sizes that were selected --- cfquery name=GetItemSizes datasource=#application.dsn# SELECT FKSizeID, FKItemID FROM tblItemSizes WHERE (FKItemID = #url.ItemID#) /cfquery !--- This query gets all possible sizes -- cfquery name=GetSizes datasource=#application.dsn# SELECT SizeID, Size FROM tblSizes WHERE 0=0 ORDER BY size ASC /cfquery Ok now show the selection ... tr td valign=topSize :/td td valign=top select multiple name=ModifiedSize cfoutput query=GetSizes cfif GetSizes.SizeID eq #GetItemsizes.FKSizeID# option value=#SizeID# selected#GetSizes.Size#/option cfelse option value=#GetSizes.SizeID##GetSizes.Size#/option /cfif /cfoutput /select /td /tr The thing is this shows only one selection :-( How do I loop coorectly to show all of the previous selections? Regards - Paul -- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ CFDeveloper Sponsors and contributors:- *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com* *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com* To unsubscribe, e-mail: [EMAIL PROTECTED] -- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ CFDeveloper Sponsors and contributors:- *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com* *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com* To unsubscribe, e-mail: [EMAIL PROTECTED] -- [EMAIL PROTECTED] www.creative-restraint.co.uk -- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ CFDeveloper Sponsors and contributors:- *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com* *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com* To unsubscribe, e-mail: [EMAIL PROTECTED] -- [EMAIL PROTECTED] www.creative-restraint.co.uk -- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ CFDeveloper Sponsors and contributors:- *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com* *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com* To unsubscribe, e-mail: [EMAIL PROTECTED]
RE: [ cf-dev ] Slect Multiple
Yes sorry, I used the wrong function. If your searching for 1 listcontains will also pickup 11 110 31 etc. So use listfind to make sure you only find the exact occurance. Russ -Original Message- From: Stephen Moretti (cfmaster) [mailto:[EMAIL PROTECTED] Sent: 20 September 2004 07:40 To: [EMAIL PROTECTED] Subject: Re: [ cf-dev ] Slect Multiple Russ Michaels (Snake) wrote: Put the selected sizes in a list, and then when you loop over the query to create the selectlist options, check if each value is in the list. E.G cfset selectedItems = Valuelist(GetItemSizes.FKSizeIF) select multiple name=ModifiedSize cfoutput query=GetSizes option value=#GetSizes.SizeID# #IIF(Listcontains(SelectedItems, SizeID), DE('selected'),DE(''))##GetSizes.Size#/option /cfoutput /select #IIF(ListFind(SelectedItems, SizeID),DE('selected'),DE(''))# Use listfind, not listcontains. Otherwise you could end up in a whole world of pain. ;o) Stephen -- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ CFDeveloper Sponsors and contributors:- *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com* *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com* To unsubscribe, e-mail: [EMAIL PROTECTED] -- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ CFDeveloper Sponsors and contributors:- *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com* *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com* To unsubscribe, e-mail: [EMAIL PROTECTED]
RE: [ cf-dev ] Slect Multiple
Oh don't start with that IIF performance , you must save 1th of a millisend crap please... It's pathetic. -Original Message- From: Andy Allan [mailto:[EMAIL PROTECTED] Sent: 20 September 2004 09:33 To: [EMAIL PROTECTED] Subject: RE: [ cf-dev ] Slect Multiple Wouldn't this do the trick... select multiple name=ModifiedSize cfoutput query=GetSizes cfif SizeID eq GetItemsizes.FKSizeID option value=#SizeID# selected=selected#Size#/option /cfif option value=#SizeID##Size#/option /cfoutput /select And it's certainly better performance wise to use a normal cfif over IIF. Andy Quoting Russ Michaels (Snake) [EMAIL PROTECTED]: Put the selected sizes in a list, and then when you loop over the query to create the selectlist options, check if each value is in the list. E.G cfset selectedItems = Valuelist(GetItemSizes.FKSizeIF) select multiple name=ModifiedSize cfoutput query=GetSizes option value=#GetSizes.SizeID# #IIF(Listcontains(SelectedItems, SizeID), DE('selected'),DE(''))##GetSizes.Size#/option /cfoutput /select Russ -Original Message- From: Paul Swingewood [mailto:[EMAIL PROTECTED] Sent: 19 September 2004 21:11 To: [EMAIL PROTECTED] Subject: [ cf-dev ] Slect Multiple I have a modify form. I want to show the multiple values of a select that were cosen when the user entered the data. I have this !--- This query gets those sizes that were selected --- cfquery name=GetItemSizes datasource=#application.dsn# SELECT FKSizeID, FKItemID FROM tblItemSizes WHERE (FKItemID = #url.ItemID#) /cfquery !--- This query gets all possible sizes -- cfquery name=GetSizes datasource=#application.dsn# SELECT SizeID, Size FROM tblSizes WHERE 0=0 ORDER BY size ASC /cfquery Ok now show the selection ... tr td valign=topSize :/td td valign=top select multiple name=ModifiedSize cfoutput query=GetSizes cfif GetSizes.SizeID eq #GetItemsizes.FKSizeID# option value=#SizeID# selected#GetSizes.Size#/option cfelse option value=#GetSizes.SizeID##GetSizes.Size#/option /cfif /cfoutput /select /td /tr The thing is this shows only one selection :-( How do I loop coorectly to show all of the previous selections? Regards - Paul -- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ CFDeveloper Sponsors and contributors:- *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com* *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com* To unsubscribe, e-mail: [EMAIL PROTECTED] -- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ CFDeveloper Sponsors and contributors:- *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com* *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com* To unsubscribe, e-mail: [EMAIL PROTECTED] -- [EMAIL PROTECTED] www.creative-restraint.co.uk -- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ CFDeveloper Sponsors and contributors:- *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com* *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com* To unsubscribe, e-mail: [EMAIL PROTECTED] -- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ CFDeveloper Sponsors and contributors:- *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com* *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com* To unsubscribe, e-mail: [EMAIL PROTECTED]
RE: [ cf-dev ] Slect Multiple
No need to be nasty ... the intention wasn't meant to start a debate about IIF. Andy Quoting Russ Michaels (Snake) [EMAIL PROTECTED]: Oh don't start with that IIF performance , you must save 1th of a millisend crap please... It's pathetic. -Original Message- From: Andy Allan [mailto:[EMAIL PROTECTED] Sent: 20 September 2004 09:33 To: [EMAIL PROTECTED] Subject: RE: [ cf-dev ] Slect Multiple Wouldn't this do the trick... select multiple name=ModifiedSize cfoutput query=GetSizes cfif SizeID eq GetItemsizes.FKSizeID option value=#SizeID# selected=selected#Size#/option /cfif option value=#SizeID##Size#/option /cfoutput /select And it's certainly better performance wise to use a normal cfif over IIF. Andy Quoting Russ Michaels (Snake) [EMAIL PROTECTED]: Put the selected sizes in a list, and then when you loop over the query to create the selectlist options, check if each value is in the list. E.G cfset selectedItems = Valuelist(GetItemSizes.FKSizeIF) select multiple name=ModifiedSize cfoutput query=GetSizes option value=#GetSizes.SizeID# #IIF(Listcontains(SelectedItems, SizeID), DE('selected'),DE(''))##GetSizes.Size#/option /cfoutput /select Russ -Original Message- From: Paul Swingewood [mailto:[EMAIL PROTECTED] Sent: 19 September 2004 21:11 To: [EMAIL PROTECTED] Subject: [ cf-dev ] Slect Multiple I have a modify form. I want to show the multiple values of a select that were cosen when the user entered the data. I have this !--- This query gets those sizes that were selected --- cfquery name=GetItemSizes datasource=#application.dsn# SELECT FKSizeID, FKItemID FROM tblItemSizes WHERE (FKItemID = #url.ItemID#) /cfquery !--- This query gets all possible sizes -- cfquery name=GetSizes datasource=#application.dsn# SELECT SizeID, Size FROM tblSizes WHERE 0=0 ORDER BY size ASC /cfquery Ok now show the selection ... tr td valign=topSize :/td td valign=top select multiple name=ModifiedSize cfoutput query=GetSizes cfif GetSizes.SizeID eq #GetItemsizes.FKSizeID# option value=#SizeID# selected#GetSizes.Size#/option cfelse option value=#GetSizes.SizeID##GetSizes.Size#/option /cfif /cfoutput /select /td /tr The thing is this shows only one selection :-( How do I loop coorectly to show all of the previous selections? Regards - Paul -- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ CFDeveloper Sponsors and contributors:- *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com* *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com* To unsubscribe, e-mail: [EMAIL PROTECTED] -- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ CFDeveloper Sponsors and contributors:- *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com* *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com* To unsubscribe, e-mail: [EMAIL PROTECTED] -- [EMAIL PROTECTED] www.creative-restraint.co.uk -- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ CFDeveloper Sponsors and contributors:- *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com* *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com* To unsubscribe, e-mail: [EMAIL PROTECTED] -- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ CFDeveloper Sponsors and contributors:- *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com* *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com* To unsubscribe, e-mail: [EMAIL PROTECTED] -- [EMAIL
RE: [ cf-dev ] Slect Multiple
Sorry but I just get sick of people quoting that in some attempt to be smart when they obviously haven't tested it. -Original Message- From: Andy Allan [mailto:[EMAIL PROTECTED] Sent: 20 September 2004 11:20 To: [EMAIL PROTECTED] Subject: RE: [ cf-dev ] Slect Multiple No need to be nasty ... the intention wasn't meant to start a debate about IIF. Andy Quoting Russ Michaels (Snake) [EMAIL PROTECTED]: Oh don't start with that IIF performance , you must save 1th of a millisend crap please... It's pathetic. -Original Message- From: Andy Allan [mailto:[EMAIL PROTECTED] Sent: 20 September 2004 09:33 To: [EMAIL PROTECTED] Subject: RE: [ cf-dev ] Slect Multiple Wouldn't this do the trick... select multiple name=ModifiedSize cfoutput query=GetSizes cfif SizeID eq GetItemsizes.FKSizeID option value=#SizeID# selected=selected#Size#/option /cfif option value=#SizeID##Size#/option /cfoutput /select And it's certainly better performance wise to use a normal cfif over IIF. Andy Quoting Russ Michaels (Snake) [EMAIL PROTECTED]: Put the selected sizes in a list, and then when you loop over the query to create the selectlist options, check if each value is in the list. E.G cfset selectedItems = Valuelist(GetItemSizes.FKSizeIF) select multiple name=ModifiedSize cfoutput query=GetSizes option value=#GetSizes.SizeID# #IIF(Listcontains(SelectedItems, SizeID), DE('selected'),DE(''))##GetSizes.Size#/option /cfoutput /select Russ -Original Message- From: Paul Swingewood [mailto:[EMAIL PROTECTED] Sent: 19 September 2004 21:11 To: [EMAIL PROTECTED] Subject: [ cf-dev ] Slect Multiple I have a modify form. I want to show the multiple values of a select that were cosen when the user entered the data. I have this !--- This query gets those sizes that were selected --- cfquery name=GetItemSizes datasource=#application.dsn# SELECT FKSizeID, FKItemID FROM tblItemSizes WHERE (FKItemID = #url.ItemID#) /cfquery !--- This query gets all possible sizes -- cfquery name=GetSizes datasource=#application.dsn# SELECT SizeID, Size FROM tblSizes WHERE 0=0 ORDER BY size ASC /cfquery Ok now show the selection ... tr td valign=topSize :/td td valign=top select multiple name=ModifiedSize cfoutput query=GetSizes cfif GetSizes.SizeID eq #GetItemsizes.FKSizeID# option value=#SizeID# selected#GetSizes.Size#/option cfelse option value=#GetSizes.SizeID##GetSizes.Size#/option /cfif /cfoutput /select /td /tr The thing is this shows only one selection :-( How do I loop coorectly to show all of the previous selections? Regards - Paul -- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ CFDeveloper Sponsors and contributors:- *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com* *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com* To unsubscribe, e-mail: [EMAIL PROTECTED] -- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ CFDeveloper Sponsors and contributors:- *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com* *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com* To unsubscribe, e-mail: [EMAIL PROTECTED] -- [EMAIL PROTECTED] www.creative-restraint.co.uk -- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ CFDeveloper Sponsors and contributors:- *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com* *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com* To unsubscribe, e-mail: [EMAIL PROTECTED] -- These lists are syncronised with the CFDeveloper forum at http
RE: [ cf-dev ] Slect Multiple
My apologies too ... you're absolutely 100% correct in that a situation like this, using cfif or iif will not make a difference. My intentions certainly weren't to be smart. Maybe I'm being naive in quoting Macromedia themselves, but they do publicly state that IIF requires more processing power as IIF is basically a shortcut way of using the Evaulate() function, but as I said, in a situation like the code posted it's not going to make a single bit of difference. Maybe I should have been clearer... me bad. One thing I will stand by though is that cfif is definately more readable than IIF :) Regardless of all that, Paul's code now does what he wants so everybody is happy :) Quoting Russ Michaels (Snake) [EMAIL PROTECTED]: Sorry but I just get sick of people quoting that in some attempt to be smart when they obviously haven't tested it. -Original Message- From: Andy Allan [mailto:[EMAIL PROTECTED] Sent: 20 September 2004 11:20 To: [EMAIL PROTECTED] Subject: RE: [ cf-dev ] Slect Multiple No need to be nasty ... the intention wasn't meant to start a debate about IIF. Andy Quoting Russ Michaels (Snake) [EMAIL PROTECTED]: Oh don't start with that IIF performance , you must save 1th of a millisend crap please... It's pathetic. -Original Message- From: Andy Allan [mailto:[EMAIL PROTECTED] Sent: 20 September 2004 09:33 To: [EMAIL PROTECTED] Subject: RE: [ cf-dev ] Slect Multiple Wouldn't this do the trick... select multiple name=ModifiedSize cfoutput query=GetSizes cfif SizeID eq GetItemsizes.FKSizeID option value=#SizeID# selected=selected#Size#/option /cfif option value=#SizeID##Size#/option /cfoutput /select And it's certainly better performance wise to use a normal cfif over IIF. Andy Quoting Russ Michaels (Snake) [EMAIL PROTECTED]: Put the selected sizes in a list, and then when you loop over the query to create the selectlist options, check if each value is in the list. E.G cfset selectedItems = Valuelist(GetItemSizes.FKSizeIF) select multiple name=ModifiedSize cfoutput query=GetSizes option value=#GetSizes.SizeID# #IIF(Listcontains(SelectedItems, SizeID), DE('selected'),DE(''))##GetSizes.Size#/option /cfoutput /select Russ -Original Message- From: Paul Swingewood [mailto:[EMAIL PROTECTED] Sent: 19 September 2004 21:11 To: [EMAIL PROTECTED] Subject: [ cf-dev ] Slect Multiple I have a modify form. I want to show the multiple values of a select that were cosen when the user entered the data. I have this !--- This query gets those sizes that were selected --- cfquery name=GetItemSizes datasource=#application.dsn# SELECT FKSizeID, FKItemID FROM tblItemSizes WHERE (FKItemID = #url.ItemID#) /cfquery !--- This query gets all possible sizes -- cfquery name=GetSizes datasource=#application.dsn# SELECT SizeID, Size FROM tblSizes WHERE 0=0 ORDER BY size ASC /cfquery Ok now show the selection ... tr td valign=topSize :/td td valign=top select multiple name=ModifiedSize cfoutput query=GetSizes cfif GetSizes.SizeID eq #GetItemsizes.FKSizeID# option value=#SizeID# selected#GetSizes.Size#/option cfelse option value=#GetSizes.SizeID##GetSizes.Size#/option /cfif /cfoutput /select /td /tr The thing is this shows only one selection :-( How do I loop coorectly to show all of the previous selections? Regards - Paul -- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ CFDeveloper Sponsors and contributors:- *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com* *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com* To unsubscribe, e-mail: [EMAIL PROTECTED] -- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ CFDeveloper Sponsors and contributors:- *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com
RE: [ cf-dev ] Slect Multiple
silentmust not start another thread on IIF() /silent Russ -- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ CFDeveloper Sponsors and contributors:- *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com* *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com* To unsubscribe, e-mail: [EMAIL PROTECTED]