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

How do I add an anchor to a url when the url also includes a coldfustion query variable?

I have the following url that I want to add an anchor to:

<a href="delete_employee_privilege.cfm?EmployeePrivilegeID=#getPrivileges.EmployeePrivilegeID#">

I know with a normal url variable you just add #anchor at the end and it works, but it does not work with url variable is a coldfusion variable.  Is there some syntax that will make this work in this situation
    	<!--- Setup table headers --->
        	<th><a name="anchor"></a>Options</th>
            <th>Add/Remove Privilege</th>
        <cfoutput query="getPrivileges" group="Privilege">
        <!--- cfif below will alternate background color in the table row --->
        <tr <cfif #currentrow# mod 2 gt 0>bgcolor="##CFDEB1"</cfif>>
            <td class="alignCenter">#Sequence#</td>
            <!--- Determine if Employee Privilege Exists --->
            <cfif GivePrivilege IS 1>
           		<cfset IsPrivileged = "yes">
            	<cfset IsPrivileged = "no">
            <td class="alignCenter">#IsPrivileged#</td>   
            <td class="alignCenter">
            <!--- Deterimine whether to add or remove privilege --->
            <cfif GivePrivilege IS 1>
            	<a href="delete_employee_privilege.cfm?EmployeePrivilegeID=#getPrivileges.EmployeePrivilegeID#">
                Remove Privilege</a>            
            	<a href="add_employee_privilege.cfm?EmployeeID=#URL.EmployeeID#&PrivilegeID=#getPrivileges.PrivilegeID#">
                Add Privilege</a>

Open in new window

1 Solution
Andrew MaurerCommented:
Like so...
<a href="add_employee_privilege.cfm?EmployeeID=#URL.EmployeeID#&PrivilegeID=#getPrivileges.PrivilegeID###myAnchorTag">

Open in new window

lonnyoAuthor Commented:
Thank you.  I should have known that.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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