• Resolved zealzy

    (@zealzy)


    Hello I have a quesion

    I am trying to make an option to print/download as PDF multiple fields.
    For 1 field i use this code: printForm(‘.my-field2’); How can i add multiple to print?

    Thank you alreadu

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter zealzy

    (@zealzy)

    Sorry I asked the wrong question. I have named multiple fields the same classname, but when i do the print function he only picks 1. What code or what class names do i need to use?

    Plugin Author codepeople

    (@codepeople)

    Hello @zealzy

    You should call the printForm operation passing as a parameter, the selector for the field that contains all the fields to print.

    For example, assuming you have Div field with the class: for-printing and the fields to print are in it, the code to run would be: printForm('.for-printing')

    Another alternative would be print the form but hiding the rest of the fields.

    In this case, insert an “HTML Content” field in the form with the piece of code:

    
    <style>
    @media print only{
    #fbuilder .fields:not(.my-field2){display:none;}
    }
    </style>
    

    The onclick event of the button would be: printForm(this.form);

    Best regards.Hello @zealzy

    You should call the printForm operation passing as a parameter, the selector for the field that contains all the fields to print.

    For example, assuming you have Div field with the class: for-printing and the fields to print are in it, the code to run would be: printForm('.for-printing')

    Another alternative would be print the form but hiding the rest of the fields.

    In this case, insert an “HTML Content” field in the form with the piece of code:

    
    <style>
    @media print only{
    #fbuilder .fields:not(.my-field2){display:none;}
    }
    </style>
    

    The onclick event of the button would be: printForm(this.form);

    Best regards.

    Thread Starter zealzy

    (@zealzy)

    I do understand, but what if i want to print multiple classes. I can’t use this code:

    printForm(‘.for-printing,.for-printing1’); How do I do it

    Plugin Author codepeople

    (@codepeople)

    Hello @zealzy

    In this case, I recommend you to assign a second class name to the fields you want to print at once and call the printForm operation passing as the parameter the new class.

    Note, if you need to assign multiple class names to the same field, separated them by a blank character through the “Add CSS Layout Keywords”

    Best regards.

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

The topic ‘Multiple fields in print function’ is closed to new replies.