• Resolved talentoracle

    (@talentoracle)


    Greetings,

    I successfully used the tip “Printing a Form
    For printing only the form, but not the rest of page, please, follows the steps below:” to create a working print button.

    However, since there are page breaks in the form and this button is at the end of the form, it only shows the final page during print. Is it possible to print the entire form using different code / other method?

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @talentoracle,

    You simply should insert a “HTML Content” field in the form with the following piece of code as its content:

    
    <style>
    @media print{
    #fbuilder .pbreak{display:block !important;}
    }
    </style>
    

    and that’s all.
    Best regards.

    Thread Starter talentoracle

    (@talentoracle)

    Thank you very much but regretfully this did not work. I made no changes to the following print code or the print button. I only added the code mentioned from your response in a HTML Content field and tried it twice. The result is to print only the final page as it was previously.

    <SCRIPT>
    function printForm(){
    var w = window.open(null, ‘Print_Page’, ‘scrollbars=yes’);
    jQuery(‘#fbuilder input’).each(function () {
    var e = jQuery(this);
    e.text(e.val()).attr(‘value’, e.val());
    if (e.hasClass(‘large’))
    e.css(‘width’, ‘100%’);
    if (typeof e.prop(‘checked’) != ‘undefined’ && e.prop(‘checked’))
    e.attr(‘CHECKED’, e.prop(‘checked’));
    });
    var html = jQuery(‘#fbuilder’).html();
    jQuery(‘#fbuilder TEXTAREA’).each(function () {
    var e = jQuery(this).parent().html();
    html = html.replace(e, jQuery(this).val());
    });
    jQuery(‘#fbuilder SELECT’).each(function () {
    var e = jQuery(this).parent().html();
    html = html.replace(e, jQuery(this).find(‘option:selected’)[0].text);
    });
    w.document.write(html);
    w.document.close();
    w.print();
    }
    </SCRIPT>

    Plugin Author codepeople

    (@codepeople)

    Hello @talentoracle,

    Please, indicate the URL to the webpage where the form is inserted.

    By the way, the code for printing the form in “Calculated Fields Form” website was included only to demonstrate the potential of the plugin, I recommend you to use the “Print Form” block distributed with the “CP BLocks” plugin instead (remember to remove the current Print Form routine before insert the new one):

    https://ww.wp.xz.cn/plugins/cp-blocks/

    Best regards.

    Thread Starter talentoracle

    (@talentoracle)

    This note is only to assist anyone else with this issue in the future. If your site is hosted on wordpress.com, cp-blocks won’t work since it contains javascript.

    Plugin Author codepeople

    (@codepeople)

    Hello @talentoracle,

    I sent you an alternative through the private support system.

    Best regards.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Printing forms with page breaks’ is closed to new replies.