Jump to content

Preview a php page by clicking a button in a form


rekha

Recommended Posts

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title><script LANGUAGE="JavaScript">
function displayHTML(printContent) {
var inf = printContent;
win = window.open("print.html", 'popup', 'toolbar = no, status = no');
win.document.write(inf);
win.document.close(); // new line
}
</script>  
</head>

<body>
<div id="printarea">Hello how r u? ...</div><a href="javascript:void(0);" onclick="displayHTML(document.getElementById('printarea').innerHTML)">Print Preview</a>
</body>
</html>


Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.