Click to See Complete Forum and Search --> : printing certain frames


michelleskrede
06-06-2003, 08:43 AM
hi, i am wondering if anyone can help me, i don't know anything about javascript, but i hear that is what i need to do this. i have built a website with frames, a left nav. frame and the right information frame. i would like the right or mainframe, to print. when i asked this question to another forum. this is the answere i got.

<style media="print">
.noPrint { visibility:hidden }
</style>
<form>
<input type="button" onClick="window.print()"
value="print" class="noPrint">
</form>


the problem with this is that the 'print' button shows on the page. i don't want that. all i want it for the users to go to print and it automatically prints the mainframe and not the left frame. here is the site if anyone needs to see what i am talking about. http://my.oh.voyager.net/~cryobio/repro i am really new to this whole website building thing, so if anyone could explain it that would be great. thank you in advance. michelle

Khalid Ali
06-06-2003, 09:30 AM
There is a hack you can use in this case.

You will have to make sure that after everything that user does on the page you set the focus back to the frame whcih you want to print...

parent.frameName.focus();

and if this is implemented correctly...then whenever a user clicks on file+print
the frame in focus() should be printed..

michelleskrede
06-09-2003, 09:19 AM
so where exactly do i put that code. i put it right before my body tag and it doesn't seem to work for me. the user doesn't acutally do anything with the page. it is all information- read only.

Khalid Ali
06-09-2003, 11:04 AM
the code should be in the webpage
where you have defined your frames..

put code here in between the <script tags

<framset .....
<frame...
<frame..

</frameset>