You could also use a <CFSWITCH> and <CFCASE> block to do the same thing
faster (CASE statements evaluate faster that multiple IF statements),
psudeo-code:

<CFSWITCH expression="whatever.value">
        <CFCASE value="N">
                If ....
        </cfcase>
        <CFCASE value="...">
                More processing
        </cfacse>
        <CFDEFAULTCASE>
                Code for whatever.value="" goes here
        </cfdefaultcase>
</cfswitch>

-----Original Message-----
From: Chapman, Katrina [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 08, 2000 1:44 PM
To: [EMAIL PROTECTED]
Subject: RE: Hi Guys n Gals! Quick Select box question :)


You could do this.  If you do however remove the #'s from the if statements,
they're not necessary and they slow down processing.  Or you could simply
output the value in the database as the first option.  Yes it will appear
twice in the list but it's easier for you to code and it is faster as CF
doesn't have to sort through a bunch of if statements.

--K
-------------------------
Thank you,
Katrina Chapman
ColdFusion Web Developer
Systems Development
Volt Information Services

-----Original Message-----
From: John McKown [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 08, 2000 10:15 AM
To: [EMAIL PROTECTED]
Subject: RE: Hi Guys n Gals! Quick Select box question :)



<td>
<select <cfoutput>name="reason_#lookup.Audit_ID#"</cfoutput>>
  <CFIF #whatever.value# IS "">
        <option value="" SELECTED></Option>
  </CFIF>
  <option value="G" <CFIF #whatever.value# IS
"G">SELECTED</CFIF>>9/80</option>
  <option value="N" <CFIF #whatever.value# IS "N">SELECTED</CFIF>>Absent
Without Permission</option>
  <option value="F" <CFIF #whatever.value# IS "F">SELECTED</CFIF>>Funeral
Leave</option>
  <option value="I" <CFIF #whatever.value# IS
"I">SELECTED</CFIF>>Injury</option>
  <option value="J" <CFIF #whatever.value# IS "J">SELECTED</CFIF>>Jury
Duty</option>
  <option value="M" <CFIF #whatever.value# IS
"M">SELECTED</CFIF>>Maternity</option>
  <option value="O" <CFIF #whatever.value# IS "O">SELECTED</CFIF>>Other
Approved Absences</option>
  <option value="H" <CFIF #whatever.value# IS "H">SELECTED</CFIF>>Public
Holiday</option>
  <option value="S" <CFIF #whatever.value# IS "S">SELECTED</CFIF>>Sick
Leave</option>
  <option value="U" <CFIF #whatever.value# IS "U">SELECTED</CFIF>>Surgical
Leave</option>
  <option value="S" <CFIF #whatever.value# IS
"S">SELECTED</CFIF>>Suspension</option>
  <option value="C" <CFIF #whatever.value# IS "C">SELECTED</CFIF>>Time
Off</option>
  <option value="T" <CFIF #whatever.value# IS
"T">SELECTED</CFIF>>Training/Conferences/Team Building</option>
  <option value="W" <CFIF #whatever.value# IS
"W">SELECTED</CFIF>>Weekend</option>
  <option value="A" <CFIF #whatever.value# IS
"A">SELECTED</CFIF>>Vacation</option>
  </select>
</td>


John McKown, VP Business Services
Delaware.Net, Inc.


-----Original Message-----
From: Ang�l Stewart [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 08, 2000 12:37 PM
To: [EMAIL PROTECTED]
Subject: Hi Guys n Gals! Quick Select box question :)


I need a select box to display a value from a database.

The box is not dynamic, and it is not a CFSelect box.

It is a regular, plain vanilla <select> statement sitting inside a CFFORM
inside a <CFLOOP query="qrySelectRecords"> statement.

I just know this is really really easy for you gurus..but I just can't
figure it out at the moment..

here is the box code as it is now:

<td><select <cfoutput>name="reason_#lookup.Audit_ID#"</cfoutput>>
  <option value="" SELECTED></Option>
  <option value="G">9/80</option>
  <option value="N">Absent Without Permission</option>
  <option value="F">Funeral Leave</option>
  <option value="I">Injury</option>
  <option value="J">Jury Duty</option>
  <option value="M">Maternity</option>
  <option value="O">Other Approved Absences</option>
  <option value="H">Public Holiday</option>
  <option value="S">Sick Leave</option>
  <option value="U">Surgical Leave</option>
  <option value="S">Suspension</option>
  <option value="C">Time Off</option>
  <option value="T">Training/Conferences/Team Building</option>
  <option value="W">Weekend</option>
  <option value="A">Vacation</option>
  </select></td>

</tr>

Thanks all!
-Gel


----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebarRsts&bodyRsts/cf_talk or send a message 
to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to