• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CFSCRIPT

New Here ,
Jul 13, 2006 Jul 13, 2006

Copy link to clipboard

Copied

Everyone -

I know this is easy, but I don't know CFScript. I want to add the equivilent to CFELSEIF to the following, allowing me a third option for my nav.

if (listlast(cgi.SCRIPT_NAME,"/") eq "merchantsolutions.cfm") {
link1 = "<a href=""URLHere"" title=""Developing What You Need"" target=""_blank"">Site Design</a>";
}
else
{
link1 = "<a href=""URLHere"" title=""Products You Need"" target=""_blank"">Web Products</a>";
}

How do I add a 3rd option to this?

Thanks!
TOPICS
Advanced techniques

Views

212

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 13, 2006 Jul 13, 2006

Copy link to clipboard

Copied

I've gone over this recently, and help can be found in the following resource:

livedocs.macromedia.com

It includes the following information:

CFScript does not include an elseif statement. However, you can use an if statement immediately after an else statement to create the equivalent of a cfelseif tag, as the following example shows:

if(score GT 1)
result = "positive";
else if(score EQ 0)
result = "zero";
else
result = "negative";

Hope that helps.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 13, 2006 Jul 13, 2006

Copy link to clipboard

Copied

LATEST
Thanks. I knew it would be easy, just coudn't find the syntax. Cheers, that's a great help DevGuy.

Bill

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation