allowing visitor to print an iframe page containing their orders. via a print button in another wind

G

Guest

I have a conformation page thanking the visitor for their order and wish to
allow them to print it via a print button also on the conformation page.
the details to print are contained in an iframe in the previous window shown
behind the newly opened conformation window.
how can I achieve this ?

thank you.
 
M

MD Websunlimited

Cheers,

Iframes are just another window contained within the window.frames array therefore you can just do a print on the window for the
iFrame

window.frames[1].print();
 
G

Guest

hi,

I have typed in what you gave but nothing happens.

I have looked on the net and found this

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
if (window.print) {
document.write('<form>If you wish to Print your order click '
+ '<input type=button name=print value="Print order" '
+ 'onClick="javascript:parent.showorderpageiframe.print();"></form>');
}
// End -->
</script>

and prints the page that has the print button, not the page that I think I
have asked it to print, being 'showorderpageiframe'


MD Websunlimited said:
Cheers,

Iframes are just another window contained within the window.frames array
therefore you can just do a print on the window for the iFrame

window.frames[1].print();
--
Mike -- FrontPage MVP '97 - '02
http://www.websunlimited.com



I have a conformation page thanking the visitor for their order and wish
to allow them to print it via a print button also on the conformation
page. the details to print are contained in an iframe in the previous
window shown behind the newly opened conformation window.
how can I achieve this ?

thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top