The absolute easiest way to solve this problem would be to make the option
value a comma delimited list as follows:
<select name="Region">
          <option value="[EMAIL PROTECTED],Africa" selected>Africa</option>
          <option mailto:value="[EMAIL PROTECTED],Asia &amp; Pacific">Asia &amp;
Pacific</option>
          <option mailto:value="[EMAIL PROTECTED],Eastern South America">Eastern
South America</option>
 </select>

Then on your output page do the following:

<cfoutput>
Email: #listgetat(FORM.Region,1)#
Region #listgetat(FORM.Region,2)#
</cfoutput>

Of course the easiest way to do it now might not be the easiest way to in
the future. What happens when you need to add a new region and email or what
if you need to display more information than a contact email and region? You
are better off putting all the information into a database and pulling it as
you need it, that way you wont need to edit any html when another region is
added...

jon
----- Original Message -----
From: "Les Mizzell" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, October 11, 2000 8:08 PM
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