Click to See Complete Forum and Search --> : print button on the popup menu


chialh00
06-13-2003, 02:02 PM
Hi, I am having problem printing the popup menu, please see attached code.

Thanks and appreciate your help.



<SCRIPT LANGUAGE="JavaScript">



function openpopup(){

text = "<html>\n<head>\n<title>Please Note</title>\n<body>\n";
//text += "<center>\n<br>";

text += "Please note the following information as you will need it to complete the requested forms.\n<br><br>";
text += "<b>Your Number is: ></b>\n<br>";





winpops=window.open("","","width=400,height=338,menubar");

winpops.document.write('<form>'+ '<input type=button name=print value="Print"'+ 'onClick="window.print()"> this page!</form>');
winpops.document.write(text);


}





</script>




</head>

Jona
06-13-2003, 02:21 PM
You're missing a space before the apostrophe after name=Print" It should be: name=Print" '+ ...

Jona

chialh00
06-13-2003, 02:35 PM
Originally posted by Jona
You're missing a space before the apostrophe after name=Print" It should be: name=Print" '+ ...

Jona


Thanks. Jona. I made the changes, but the print still does not work. It also does not work if I add the below code on the popup menu

text += "<button onClick ='window.print()'>Print</button>";

Jona
06-13-2003, 02:38 PM
It might be a security thing...

Jona

Khalid Ali
06-13-2003, 02:48 PM
Here you See how the code is different then yours a tiny bit..

function openpopup(){

text = "<html>\n<head>\n<title>Please Note</title>\n<body>\n";
//text += "<center>\n<br>";

text += "Please note the following information as you will need it to complete the requested forms.\n<br><br>";
text += "<b>Your Number is: ></b>\n<br>";
winpops=window.open("","","width=400,height=338,menubar");
winpops.document.open();
winpops.document.write('<form>'+ '<input type=button name=print value="Print"'+ 'onclick="window.print()"> this page!</form>'+text);
winpops.document.close();
}

chialh00
06-13-2003, 02:48 PM
Originally posted by Jona
It might be a security thing...

Jona


ok. Thanks. Jona

chialh00
06-13-2003, 02:53 PM
Thanks. Khalid. It works now! yippy.

Khalid Ali
06-13-2003, 02:56 PM
:D
ya're welcome..:p