Les;

If you are filling this list box with dynamically generated code, what about
this?

<CFLOOP QUERY="myQry">
<select name="region">
        <CFIF myqry.Country EQ "Africa">
                <option value="#myqry.email#" selected>#myqry.Country#
#myqry.email#</option>
        <CFELSE>
                <option value="#myqry.email#">#myqry.Country# #myqry.email#</option>
        </cfif>
</select>
</cfloop>

Larry Juncker
Senior Cold Fusion Programmer
Heartland Communications Group, Inc.


-----Original Message-----
From: Les Mizzell [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 11, 2000 7:08 PM
To: CF-Talk
Subject: How to display Value and Label from listbox


Trying to figure out how to format output for a listbox on a form, such as
below:

       <select name="Region">
          <option value="[EMAIL PROTECTED]" selected>Africa</option>
          <option value="[EMAIL PROTECTED]">Asia &amp; Pacific</option>
          <option value="[EMAIL PROTECTED]">Eastern South America</option>
        </select>

On the action page, I can easily get the value to come up

<CFOUTPUT>
#Region#
</CFOUTPUT>

However, I need BOTH the value, and the Item Label to display, like:

Region  Email
Africa  [EMAIL PROTECTED]

For processing purposes, I'm ONLY using the value (the email address) but
for display purposes, and since there's close to 50 regions in the list, I
need to see the label as well so the client will know if they selected the
right region or not.

That make any sense?

Thanks!

Les Mizzell
***********
Some people say I'm too apathetic.
But why should I care?

----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
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/cf-talk@houseoffusion.com/
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.

Reply via email to