Could also code it all like this.... if you are anal like me..

<cfset l_OS = "Windows 95,Windows 98, Windows ME,Windows XP">
<select name="selectSystem" size="1" class="inputfield">
        <option value="">Select System...</option>
        <cfloop list="#l_OS#" index="sIndex">
                <cfset sIndex = Trim(sIndex)>
                <option value="#sIndex#"<cfif Compare(FORM.selectSystem,
sIndex) EQ 0> selected="selected"</cfif>>#sIndex#</option>
        </cfloop>
</select>

Course... I aint tested it :-)

Then you can just add to the list as you need and it will all take care
of itself.....

hehehe soz for being anal but banging my head a wall trying to do what I
am meant to do today :-(

> -----Original Message-----
> From: Eric Creese [mailto:[EMAIL PROTECTED] 
> Sent: 04 June 2003 14:40
> To: CF-Talk
> Subject: RE: Selecting form
> 
> 
> for onee you are missing an ending " for the value
> 
> -----Original Message-----
> From: Bushy [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 04, 2003 8:37 AM
> To: CF-Talk
> Subject: RE: Selecting form
> 
> 
> Whats wrong with the below syntax?
> 
>                         <select name="selectSystem" size="1" 
> class="inputfield">
>                                   <option value="" 
> default>Select System...</option>
>                                   <option value="Windows 
> 95<cfif FORM.value EQ "Windows 95"> selected</cfif>>Windows 
> 95</option>
>                                   <option value="Windows 
> 98<cfif FORM.value EQ "Windows 98"> selected</cfif>>Windows 
> 98</option>
>                                   <option value="Windows 
> ME<cfif FORM.value EQ "Windows ME"> selected</cfif>>Windows 
> ME</option>
>                                   <option value="Windows 
> NT<cfif FORM.value EQ "Windows NT"> selected</cfif>>Windows 
> NT</option>
>                                   <option value="Windows 
> XP<cfif FORM.value EQ "Windows XP"> selected</cfif>>Windows 
> XP</option>
>                                   <option value="Windows 
> 2000<cfif FORM.value EQ "Windows 2000"> 
> selected</cfif>>Windows 2000</option>
>                             </select>
> 
> 
> On Wed, 4 Jun 2003 13:28:44 +0100, Adrian Lynch wrote:
> 
> > Because the options are hardcoded you will have to put the 
> cfif inside 
> > each option and something like:
> > 
> > <option value="Nintendo GameCube"<cfif FORM.value EQ "Nintendo 
> > GameCube"> selected</cfif>>Nintendo GameCube</option> <option 
> > value="Nintendo GameBoy"<cfif FORM.value EQ "Nintendo GameBoy"> 
> > selected</cfif>>Nintendo GameBoy</option> ............
> > 
> > Ade
> > 
> > -----Original Message-----
> > From: Bushy [mailto:[EMAIL PROTECTED]
> > Sent: 04 June 2003 13:07
> > To: CF-Talk
> > Subject: Selecting form
> > 
> > 
> > Hi,
> > 
> > I have a form where I'm storing all the input fields into 
> > FORM.variables so if the user hits the "refresh" the form 
> is reloaded 
> > and all the input fields are retained.
> > 
> > I have a dropdown menu selection in my form. How can I have 
> the below 
> > code do the same. What am I doing wrong?
> > 
> > 
> > Console&nbsp;System:&nbsp;
> > <select name="selectSystem" size="1" class="inputfield"> 
> <cfif value 
> > is FORM.value>
> >   <cfset isSelected='selected'>
> > <cfelse>
> >   <cfset isSelected = ''>
> > </cfif>
> > <option value="" default>Select System...</option>
> > <option value="Nintendo GameCube" #isSelected#>Nintendo 
> > GameCube</option> <option value="Nintendo GameBoy" 
> > #isSelected#>Nintendo GameBoy</option> <option 
> value="Microsoft XBox" 
> > #isSelected#>Microsoft XBox</option> </select>
> > 
> > 
> > 
> > 
> > 
> 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Host with the leader in ColdFusion hosting. 
Voted #1 ColdFusion host by CF Developers. 
Offering shared and dedicated hosting options. 
www.cfxhosting.com/default.cfm?redirect=10481

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to