We have a simple outputLink whose only function is to print the current page. This is working fine in Firefox and Chrome, but in IE8 it opens the Print dialog box and then promptly crashes.
<apex:outputLink value="#" styleClass="navImageCustom printImage" title="Print" onclick="window.print();"/>
In IE9 it also opens the Print dialog, but the page refreshes and gives the error "The name can only contain underscores and alphanumeric characters. It must begin with a letter and be unique, and must not include spaces, end with an underscore, or contain two consecutive underscores.”"
I tried adding a "return false;" to the onclick but the crash remains. What's the easiest way to print a Visualforce page?
Edit: <div class="navImageCustom printImage" onclick="window.print(); return false;"></div>
also fails.