Is it possible to add a empty form field no-print
insert for a FORM? Any empty form fields I do not want to print
@media print
{
.no-print, .no-print *
{
display: none !important;
}
}
Is it possible to add a empty form field no-print
insert for a FORM? Any empty form fields I do not want to print
@media print
{
.no-print, .no-print *
{
display: none !important;
}
}
I assume this will do the trick:
window.onbeforeprint = function() {
var inputElements = document.querySelectorAll("input"),
inputElementsLength = inputElements.length;
for(var i=0; i< inputElementsLength, i++) {
if(!inputElements[i].value) { // if empty
inputElements[i].classList.add("no-print");
}
}
};