How can i hide div from print?

Hi,

Can you clarify the question a little please.

Do you mean you want to hide certain portions of that page when sending to a printer or were you talking about printing to screen?

If you were talking about sending to a printer than you would need CSS media queries for print and just print the items you want which is pretty straight forward assuming you know which items they are beforehand.

However from your question is sounds like you want a logical operation where you don’t want blank fields printed if they haven’t been filled in. That would require javascript to detect the items and indeed would need a JS print button added also because if a user used the browsers print control then the js would never be run.

If you can clarify the problem or confirm the above then progress can be made towards a solution but I believe it will be more complicated than it sounds if you are talking about not printing form elements that have not had content entered.

1 Like