0

On one of our pages the user has the option to print a selected list of html pages. This is how it is at the moment

var rowcount = FrmMain.RowCount;
var frame = FrmMain.Frame;
for(i=1;i<=rowcount;i++)
{
    var obj = FrmMain.elements("chk_" + i);
    if(obj.checked)
    {
        frame.src = FrmMain.elements("hpath" + i).value;
        window.frames[frame.id].focus();
        window.frames[frame.id].print();
    }
}

Now this works fine. The problem is that on each loop the print dialog box is displayed and the user has to click print.

Basically, what I'm asking is whether that is a way to supress this dialog. It must appear at the first time but hide thereafter. Some thing like below

var show = true;
...
{
    ...
    {
        ...
        if(show)
        {
            window.frames[frame.id].focus();
            window.frames[frame.id].print();
            show = false;
        }
        else
        {
            window.frames[frame.id].focus();
            window.frames[frame.id].printwithoutdialog();
        }
    }
}

I hope I've been clear. Thanks in advance.

3
  • 1
    Do you really think that a webpage can print silently and automatically? Commented May 23, 2011 at 15:46
  • I wouldn't be asking if I knew. I'm guessing it can't by your comment. Commented May 23, 2011 at 15:49
  • is this for an internal site or public website? Commented May 24, 2011 at 2:58

2 Answers 2

1

For security / privacy reasons, this is impossible.
Otherwise, ads would automatically print their brochures.

Instead, you can combine all of the pages into a single frame.

Sign up to request clarification or add additional context in comments.

Comments

0

Some browsers have an option bypass the dialog, but it can't be done in javascript.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.