Try something like this:

<select name="selectSystem" size="1" class="inputfield">
<option value="" <cfif NOT Len(form.value)>selected</cfif>>Select
system...</option>
<option value=" Nintendo GameCube" <cfif NOT CompareNoCase("Nintendo
GameCube",form.value)>selected</cfif> Nintendo GameCube</option>
...
</select>


If your drop down box is being populated from a query it becomes easier:

<select name="selectSystem">
<cfloop query="systemSelect">
<option value="#value#" <cfif NOT
CompareNoCase(value,form.selectSystem)>selected</cfif>>#display#</option
>
</cfloop>
</select>


André
-----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