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:   It works fine with cfif...
Date:   2002-11-05 13:55:12
From:   adolph
Response to: cfswitch / cfcase ???

using the following code:
<cfparam name="switch_value" default="1">
<cfif switch_value eq "1">
<h1>1</h1>
<cfset switch_value = "2">
<cfelseif switch_value eq "2">
<h1>2</h1>
</cfif>
<hr>
<cfif switch_value eq "1">
<h1>1</h1>
<cfset switch_value = "2">
<cfelseif switch_value eq "2">
<h1>2</h1>
</cfif>
<form method="post">
<input type="text" name="switch_value" value="<cfoutput>#switch_value#</cfoutput>">
<input type="submit" name="Submit" value="Submit">
</form>