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

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


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


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Gurpreet Singh RandhawaCEOCommented:
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...  
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

Gurpreet Singh RandhawaCEOCommented:
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 RandhawaCEOCommented:
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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.