• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 391
  • Last Modified:

Dynamically change status of selected in CFLAYOUT tag

I was wondering if there was a way to change the status of selected in the CFLAYOUT tag.
im using the tabs for office locations - each tab is a different location.
The end user wants to be able to click on a location from a different page that will take them to the office locations page and the location they have clicked on will be the tab that is shown as selected.

i tried the following but could not get anything to work
<cfif IsDefined("URL.location") AND #URL.location# EQ "belfast">
<cflayoutarea name="Belfast" title="Belfast" selected="true">
<cfelse>
<cflayoutarea name="Belfast" title="Belfast">
</cfif

i also tried putting the if around the selected part of CFLAYOUT
<cflayoutarea name="Belfast" title="Belfast" <cfif IsDefined("URL.location") AND #URL.location# EQ "belfast">selected="true"</cfif>>

but each one kept throwing back errors and would not work, so if anyone could help that would be great
0
admoortown
Asked:
admoortown
  • 2
1 Solution
 
ZvonkoSystems architectCommented:
Check this:
<cfif IsDefined("URL.location") AND #URL.location# EQ "belfast">
<cfset belSel="true" >
<cfelse>
<cfset belSel="false" >
</cfif>
 
<cflayoutarea name="Belfast" title="Belfast" selected="#belSel#" >

Open in new window

0
 
admoortownAuthor Commented:
thanks Zvonko - ill try it out later today hopefully and let you know
0
 
admoortownAuthor Commented:
Great answer worked straight away
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now