Quantcast
Channel: Adobe Community : Popular Discussions - ColdFusion
Viewing all articles
Browse latest Browse all 14291

Adding a CFCASE to a Coldfusion SELECT dropdown

$
0
0

I have the following simple dropdown on my form:

---------------------------------------------------------

                          <select name="ttTo" id="ttTo" >

                            <option value="">Choose One</option>

                            <cfoutput query="rsTicketTo">

                              <option value="#rsTicketTo.ttEmail#">#rsTicketTo.ttDesc#</option>

                            </cfoutput>

                          </select>

                        </div>

--------------------------------------------------------

 

How would I change my select above to include the sample functionality below but using ColdFusion?

Note: The #TicketType# variable below will be on the page but not from the same table as the ttTo value.

 

       // Check where to send support request to...

       switch (trim($fTicketTo))

       {

       case "":

$error = 1;

$tMessage = "You must select a valid Recipient!";

break;

 

       case "Service":

if ($fTicketType == "T1")

{

$fTicketTo = 'serv1@xyz.com';

}

else

{

$fTicketTo = 'serv2@xyz.com';

}

break;

 

       case "Outage":

$fTicketTo = 'serv1@xyz.com';

break;

 

       case "Data":

$fTicketTo = 'data@xyz.com';

break;

 

       case "Voice":

$fTicketTo = 'voice@xyz.com';

break;

 

       case "T1":

$fTicketTo = 't1@xyz.com';

break;

 

       case "Wire":

$fTicketTo = 'wire@xyz.com';

break;

 

       case "Phone":

$fTicketTo = 'pst@xyz.com';

break;

 

       case "Prov":

$fTicketTo = 'prov@xyz.com';

break;

       case "Cust":

$fTicketTo = 'cc@xyz.com';

break;

 

       }


Viewing all articles
Browse latest Browse all 14291

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>