Betty Mock
Betty Mock

Reputation: 1393

coldfusion cfcase not working as per documentation

I have the following code in ColdFusion 8

<cfcase value = "envelope, addrfile">

This works fine and all is correct when the value is envelope, but when the value is addrfile the case is not executing. When I remove envelope and just write

<cfcase value = "addrfile">

the case is executed and everything is correct. The documentation says, and I quote: One cfcase tag can match multiple expression values. To do this, separate the matching values with the default value of the delimiter character. For example the following line matches "red", "blue", or "green":

<cfcase value="red,blue,green">

Can anyone suggest a reason this might not be working for me? Or a workaround that doesn't involve duplicating all the code in the case?

Upvotes: 3

Views: 140

Answers (1)

Evik James
Evik James

Reputation: 10503

I suggest removing the spaces between the elements.

<cfcase value="envelope,addrfile">

Upvotes: 8

Related Questions