I currently have a script that I run on one page where the
user can change the stylesheet.
What I want to do is create a page with an iframe where the
user can choose the stylesheet from my cfm page (lets call it
page1.cfm) and pass a variable (the stylesheet choice) to a cfm
page (lets call page2.cfm) within an iFrame. Both cfm files are on
1) Store the stylesheet choice in a session variable and the
use coldfusion to link in the correct stylesheet in your iFrame.
You would have to submit or reload your parent page and that would
force your iFrame page to reload.
2) Have your iFrame CFM page accept the stylesheet choice as
a URL variable and dynamically link in the correct stylesheet in
(e.g. myIFrame.cfm?stylesheet=green.css) once a client clicks on a
your code above is set up, you would just have to reference
myFrame.document.styleSheets to set the stylesheet for the iFrame
page. However, the advantage 1&2 have over this choice is using
coldfusion will allow you to set the stylesheet choice in a
persistent variable (i.e. session, client, etc) that will stay the
same no matter how many pages the client browses to in the iFrame