kurtatwork
05-24-2003, 03:01 PM
Ok, here's what I'm trying to do ...
I'm not interested in my own print button/function using "window.print()". I'm working with the Print function built into IE. I've got two frames, one for navigation and one for content.
When the user presses one of my nav buttons the focus is of course in the nav frame, but if he then clicks on the stock IE print function, by default the only thing that will print is the frame where the focus is (nav). The target audience for this website is older unsophisticated users so I dont want them having to use the "print preview" function or the "options" from the print dialogue box to change the IE defaults so that the content frame will print and not the nav frame.
I've tried to get around this by doing the following:
On the FRAMESET I inserted: onbeforeprint="myPrint();"
Then the Javasript looks like:
function myPrint() {
mf = window.parent.frames['mainFrame'];
nav = window.parent.frames['navFrame'];
alert(parent.document.activeElement.name);
nav.blur();
mf.focus();
alert(parent.document.activeElement.name);
}
The alerts show me that indeed the change of focus seems to be taking place to the content frame, but when I get into the print dialogue its obvious that the Nav frame is still getting passed as the "selected" frame, so the only way to get the content (mainFrame) frame to print out is by altering the print options, and most unskilled users dont have a clue about this.
Help!?!?! This is driving me insane.
-kurt
I'm not interested in my own print button/function using "window.print()". I'm working with the Print function built into IE. I've got two frames, one for navigation and one for content.
When the user presses one of my nav buttons the focus is of course in the nav frame, but if he then clicks on the stock IE print function, by default the only thing that will print is the frame where the focus is (nav). The target audience for this website is older unsophisticated users so I dont want them having to use the "print preview" function or the "options" from the print dialogue box to change the IE defaults so that the content frame will print and not the nav frame.
I've tried to get around this by doing the following:
On the FRAMESET I inserted: onbeforeprint="myPrint();"
Then the Javasript looks like:
function myPrint() {
mf = window.parent.frames['mainFrame'];
nav = window.parent.frames['navFrame'];
alert(parent.document.activeElement.name);
nav.blur();
mf.focus();
alert(parent.document.activeElement.name);
}
The alerts show me that indeed the change of focus seems to be taking place to the content frame, but when I get into the print dialogue its obvious that the Nav frame is still getting passed as the "selected" frame, so the only way to get the content (mainFrame) frame to print out is by altering the print options, and most unskilled users dont have a clue about this.
Help!?!?! This is driving me insane.
-kurt