ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  ColdFusion MX on Mac OS X, Part 3
Subject:   cfswitch / cfcase ???
Date:   2002-11-05 13:52:23
From:   adolph
Has anyone had any luck using cfswitch and cfcase? I don't think it is working on my deployment. The following code doesn't display anything but the form using cfswitch/cfcase, but it does work fine with cfif/cfelseif/cfelse....


<cfparam name="switch_value" default="1">
<cfswitch expression="switch_value">
<cfcase value="1">
<h1>Value = 1</h1>
<cfset switch_value="2">
</cfcase>
<cfcase value="2">
<h1>Value = 2</h1>
</cfcase>
</cfswitch>
<cfswitch expression="switch_value">
<cfcase value="1">
<h1>Value = 1</h1>
</cfcase>
<cfcase value="2">
<h1>Value = 2</h1>
</cfcase>
</cfswitch>
<form method="post">
<input type="text" name="switch_value" value="<cfoutput>#switch_value#</cfoutput>">
<input type="submit" name="Submit" value="Submit">
</form>


1 to 2 of 2
  1. problem was with cfswitch syntax
    2002-11-05 14:18:07  adolph [View]

    • Works for me
      2002-11-06 10:27:55  anonymous2 [View]

  2. It works fine with cfif...
    2002-11-05 13:55:12  adolph [View]

1 to 2 of 2