Posted by: hernk on: 13 April 2007
I found the script from jguru to call print preview from javascript.
I dont know whats the limitations, but its works perfectly as I expected.
Here is the script :
<html>
<head>
<title>Print Preview</title>
<script>
function printpr()
{
var OLECMDID = 7;
/* OLECMDID values:
* 6 – print
* 7 – print preview
* 1 – open window
* 4 – Save As
*/
var PROMPT = 1; // 2 DONTPROMPTUSER
var WebBrowser = ‘<OBJECT ID=”WebBrowser1″ WIDTH=0 HEIGHT=0 CLASSID=”CLSID:8856F961-340A-11D0-A96B-00C04FD705A2″></OBJECT>’;
document.body.insertAdjacentHTML(‘beforeEnd’, WebBrowser);
WebBrowser1.ExecWB(OLECMDID, PROMPT);
WebBrowser1.outerHTML [...]
Posted by: hernk on: 7 September 2006
Dalam sebuah form html kadang kita membutuhkan sebuah field bersifat readonly artinya sebuah filed hanya bisa dibaca saja tidak boleh dilakukan perubahan terhadap nilai yang dibawanya. Jika field yang dimaksud adalah button, textfield atau textarea tidak akan jadi masalah karena kita cukup memasukkan attribute readonly=readonly atau cukup readonly kedalam tag input nya, seperti <input type=text readonly=readonly>.
Masalah akan muncul apabila field yang digunakan [...]
Recent Comments