No print if not signed into your account

I only want users signed into their account to print forms. This code works well where if not in session then you can’t print. I would like to add, in this block of code a message that you have to be logged in to print, etc.

So if you were to print, all you would see is that message.

Appreciate your help.

<% if session ("log-in") = "" then %>
<style type="text/css"> @media print { body { display:none } } </style>
<%end if %>

Well you’re clearly operating in something more than HTML and CSS. So… wrap the whole main body in the if pre-rendering? Using CSS to hide the body doesn’t remove the elements from the DOM, so people can still work around it and print anyway.

Yes, I knew I could do that which is rather simple. What that code is in an include menu that has about 30 forms. So I just want to do it once, if possible, that would simply give me that message. I wasn’t sure if it could be done that simple. If I have to go into each form then I am better off leaving it the way it is.

I appreciate your thoughts and if you think of anything that would work I would appreciate it.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.