Printing Web Form - Post ID 276938

User 2140875 Photo


Registered User
364 posts

I should have been more specific. Will the html code: onclick="window.print() work on a Mac?
Thanks
User 2736027 Photo


Registered User
68 posts

Adds a form Print Button.

<form><input type="button" value=" Print this page "
onclick="window.print();return false;" /></form>


The above code does almost exactly what I need, because for forms embedded in a web page, I didn't want to use the PC's print function and have the complete web page printed, only the actual form itself.

While that part works, when I add the html code near the bottom of the form, the Submit button is re-located off the bottom of the form. I used the HTML element.

Is there a better element which would put the Print button somewhere beside or near, the Submit button??
User 187934 Photo


Senior Advisor
20,181 posts
Online Now

Hi Norm,
It sounds like your button styling is interfering with the submit button.
Can you share a link to the form?
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2736027 Photo


Registered User
68 posts

Hi Eric,

I copied the script from a post above April 17-2012 (SirAGE), Old, but I was hoping it would work:
Adds a form Print Button.

<form><input type="button" value=" Print this page "
onclick="window.print();return false;" /></form>


Adds a Print Link.
<a href="#" onclick="window.print();return false;">print</a>

I used the "Print Button method, and tried both 'return false' and 'return true'. Same issue.

I haven't tried the second 'Link' script yet, as I'm not sure how that will look on the form.
I used the HTML element with the 'Button' script, and I noticed the Submit button occupies 100% form width. I was hoping to be able to place my 'Print button' beside it, in the lower right-hand corner of the form.

I know you would like to see the form in action, but it is on a live site, and I'm somewhat reluctant to 'expose' it publicly. It also contains credentials to the database.

Any other suggestions?
User 187934 Photo


Senior Advisor
20,181 posts
Online Now

Is this form on your own host? If so I would add the print button after export and place it down near the submit button.
That's what I did for this one.
http://ericrohloff.com/coffeecup/ccforu … index.html

Here's what your code will look like after you add the print button html to the form after export. It goes within the same div holding the submit button.
<div class="fb-item-alignment-left fb-footer" id="fb-submit-button-div"
style="min-height: 0px;">
<input class="fb-button-special" id="fb-submit-button" type="submit" data-regular=""
value="Submit" />
<input type="button" value=" Print this page "
onclick="window.print();return false;" />
</div>
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2736027 Photo


Registered User
68 posts

Hi Eric,
Sorry for the late reply. I will be away for another week or so, and will check out your suggestion, once I get back.

Thanks....
User 2736027 Photo


Registered User
68 posts

Hi Eric...

Back again. I just did a quick test with the code you suggested, and instead of modifying the exported code, I simply placed the HTML directly into WFB, immediately above the normal Submit button. I set the HTML element width to 100%.

The appearance in WFB is that you now have 2 submit buttons, but when I preview the form in my browser I no longer see the standard Submit button, only the one I added plus the Print button along side.

I haven't uploaded the form to test on a working site just yet, but if it works the same way in real life, then it will save me having to tinker with exported code, and gives me exactly what I was looking for.

Fingers crossed...

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.