Change image based on template loaded in other frame

I have two frames, one is called "navigation" and the other is called "main". I want to change the image that the user clicks in the navigation frame when that page is loaded into the main frame.  Can this be done in ColdFusion or do I need to work this our with JavaScript?
krewsonAsked:
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.

bigbadbCommented:
You should use javascript.  This will probably an onclick event so it will be client side.  CF is all server side and cannot handle image swapping


If you are a little more specific about  your needs and post some code I may be able to help out more
0
krewsonAuthor Commented:
I'm not looking to image swap.  This is what I'm looking for in the navigation frame:

<a href="events.cfm" target="main">
<cfif --page in main frame-- eq "events.cfm">
<img src="events.gif">
<cfelse>
<img src="eventsselected.gif">
</cfif>
</a>

so that a different image is loaded for the button that the user is viewing in the other frame.  I just don't know how to refer to the .cfm page in the cfif.



0
Nathan Stanford SrSenior ProgrammerCommented:
As I see it you have three options...

1. JavaScript to Change image.

2. When you click on the page you can reload both pages.

3. Or load the Frames page that will load the new nav pic as well as the body.


Which of the above solutions would you need help with or was this enough information?  In other words if the above was not enough information which choice would you like help with?
0

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
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

bigbadbCommented:
in your frame window you can do a window.src == 'events.cfm' then set your img.src to be either events.gif or eventsselected.gif.  I think javascript is the best way to do this.  There is also a frame property in javascript you might be able to use
0
FRehmanCommented:
nathans is right you should reload te both pages I think you use the javscript for that purposeit is suitable for you
0
krewsonAuthor Commented:
Reloading both pages works.
0
Nathan Stanford SrSenior ProgrammerCommented:
Thanks if you need help with the javascript to load reload both pages let me know.

0
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.