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

Multiple variables in a url meant for specific tabs on coldfusion page. How do you grab the specific variable designated for the specific tab or coldfusion page?

I know how to pass multiple variables in a url. My problem is that the each variables in the url is meant for a specific tab on a coldfusion page. How do I specifically grab the appropriate variable to use within the specific tab? This is my dilemma. Thanks in advance for your help.
0
jslaught
Asked:
jslaught
  • 3
  • 2
1 Solution
 
gdemariaCommented:

It depends on your code, <cflayout> tabs are just code within the page.  So you don't need to do anything except reference the variable just like you would in any case.

If you're using the URL reference for your tab, then you need to pass the variable on the URL you are providing to the tab.

Please provide your code and describe the problem you're having (including which variable is not showing up where)

0
 
jslaughtAuthor Commented:
Below is an excerpt of my code. The excerpt represents a web page that has a link back to the home page (<a href="trackertabs.cfm?<cfoutput>#CGI.QUERY_STRING#</cfoutput>&tab=2">Click here to return to Service Tab</a> ).

Two variables are attached to the above link/url (#CGI.QUERY_STRING# and tab=2)

#CGI.QUERY_STRING# represents the username per the login to the site.
tab=2 represents the second tab on the home page.

The goal is to pass the username back to the second tab on the home page. I have been unsuccessful at separating the variables once they are both passed back to the home page.

 
<body>
<a href="http://127.0.0.1:8500/TicketTracking/trackertabs.cfm?<cfoutput>#CGI.QUERY_STRING#</cfoutput>" <br><br>

<a href="trackertabs.cfm?<cfoutput>#CGI.QUERY_STRING#</cfoutput>&tab=2">Click here to return to Service Tab</a></br />


<body> 
<center>
<font size=4>
My Service Requests 
</font>
</center>
<br>
</body>

Open in new window

0
 
jslaughtAuthor Commented:
I have been successful at getting the link to return to the 2nd tab on the home page but the username won't display due to it being attached with the 2nd variable in the url.
0
 
gdemariaCommented:

<a href="trackertabs.cfm?<cfoutput>#CGI.QUERY_STRING#</cfoutput>&tab=2">Click here to return to Service Tab</a>

If your query_string contains something like "username=john"

then in your trackerTabs.cfm file, you should easily be able to reference...

 #url.username#  =  john

and

 #url.tab#  =  2


at the top of trackerTabs.cfm  put this command...

<cfdump var="#url#">

It will show a list of all the URL variables passed which should include the username.

If it does not, it is because your cgi.query_string does not contain what you need.

If that happens, add some code next to the link to see what it does contains...

Change this...
<a href="trackertabs.cfm?<cfoutput>#CGI.QUERY_STRING#</cfoutput>&tab=2">Click here to return to Service Tab</a>

To this...

The Link is:  trackertabs.cfm?<cfoutput>#CGI.QUERY_STRING#</cfoutput>&tab=2<br>
<a href="trackertabs.cfm?<cfoutput>#CGI.QUERY_STRING#</cfoutput>&tab=2">Click here to return to Service Tab</a>

That will show the link to the screen so you can see what is being passed

0
 
jslaughtAuthor Commented:
Your suggestions above worked out well for what I was trying to do. Appreciate the help as I can now continue with my development without being stuck on this issue. Thanks again.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

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