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

CFLOCATION and anchors not working in IE7.

I am having an issue where my anchor is not carrying over in the URL. I need to use double pounds b/c I'm within a <cfoutput>. If I dump it, it is correctly populating. It's just NOT carrying over the file part in IE. (It works in Mozilla!) Has anyone run into this before?
<cflocation url = "../index.cfm?fuseaction=searchSubmit&pipe_id=#pipe_id#&type=solicitation&action=add&message=ERROR: You must enter a date.  Please use the format mm/dd/yyyy.##solAdd_#pipe_id#">

Open in new window

  • 3
  • 3
2 Solutions

You need to encode that message, you can't have those spaces and / marks on the URL

<cfset theMessage = URLencodedFOrmat("ERROR: You must enter a date.  Please use the format mm/dd/yyyy.")>

<cflocation url = "../index.cfm?fuseaction=searchSubmit&pipe_id=#pipe_id#&type=solicitation&action=add&message=#theMessage#solAdd_#pipe_id#">

  But where is the anchor?   I don't see the ## anywhere..

 Also, you need to add  this to your cflocation...


Otherwise your session will appear on the URL

Gurpreet Singh RandhawaWeb DeveloperCommented:
gdemaria is right :

do it he says or like this:

<cfset theMessage = #tobase64("ERROR: You must enter a date.  Please use the format mm/dd/yyyy.")#>

<cflocation url = "../index.cfm?fuseaction=searchSubmit&pipe_id=#pipe_id#&type=solicitation&action=add&message=#theMessage#solAdd_#pipe_id#&anchor=##colorzone">

now let's assume you on index.cfm page:

when u come back from this url, you will be going staright to the anchor tag if u have defined one in the index.cfm page as such:

<a href="#colorzone">Destination</a>

now i have used the tobase64 that will encrypt ur url, you can decrypt it using:


Hope that solves ur purpose


Instead of converting to base 64, you can just use  URLencodedFOrmat()

That's what it's for, making the string available for the URL, then you don't have to do any decoding on the other end.

Of course, I am wondering why you need to pass an error message on the URL at all...  
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Gurpreet Singh RandhawaWeb DeveloperCommented:
It makes a messsage to appear encypted that's all it do. otherwise there is no point of using it. Anyways its ur choice of using it or not..

> It makes a messsage to appear encypted

Yes, good point.   If you base64() the message, a person cannot read it on the URL, if that's important to you, then use that function instead.

Still curious why you have to do this at all..  Why not submit the page to itself, that way the form fields stay intact and the user doesn't have to re-enter all their values.
Gurpreet Singh RandhawaWeb DeveloperCommented:
Yep That point is far too better rather than relocatig to another page and coming back..

You can pre-define the foirm values in

<cfparam name="username" default="">

and like others if you have ten form fields use the cfparam for all ten fields with diffrenet names and then refrence them in ur form fields like:

<input value="#username#">

do the processing in the same page and this way your purpose will be solved and user will not get frustated to enter the info again & again..

Here is a sample for ur:


traportAuthor Commented:
Sorry I took so long to come back here. Thank you both for your help. I inherited this mess, unfortunately, and don't have time in the scope of the project to do what would be best for it - I just need to make it work. It was the hash marks causing an error and your suggestions helped immensely.

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

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