You are viewing limited content. For full access, please sign in.

Question

Question

create print button using html in new forms

asked on March 11

Is it possible to create a print button in new forms designer?  I used to do this in classic with html code.

 

<input type="button" value="Print this page" onclick="window.print()">

 

0 0

Replies

replied on March 11

There isn't a way to execute that in LFForm JS. We currently block the "allow-modals" sandbox attribute that would enable this. I can look into feasibility of this in the future.

For now, if your users are used to the print button you could keep it but make it show a tooltip instead:
 

.tooltip-toggle {
    display: none; /* Hide the checkbox */
}
.tooltip-invoke {
  border: 1px solid black;
  padding: .25rem .75rem;
}
.tooltip-content {
    display: none; /* Hide the tooltip by default */
    /* Add styling here (positioning, background, etc.) */
    position: absolute;
    background-color: #333;
    color: white;
    padding: 10px;
    border-radius: 5px;
    z-index: 10;
}

/* Show the tooltip when the checkbox is checked */
.tooltip-toggle:checked ~ button + .tooltip-content,
.tooltip-toggle:checked ~ .tooltip-content {
    display: block;
}
<label class="tooltip-wrapper">
    <input type="checkbox" class="tooltip-toggle" id="tooltip-toggle">
    <div class="tooltip-invoke">Print</div>
    <span class="tooltip-content">
        Please use ctrl+p or cmd+p to print
    </span>
</label>

 

0 0
replied on April 3

Thank you.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.