Title: Multiple fields in print function
Last modified: February 1, 2021

---

# Multiple fields in print function

 *  Resolved [zealzy](https://wordpress.org/support/users/zealzy/)
 * (@zealzy)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/multiple-fields-in-print-function/)
 * 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](https://wordpress.org/support/users/zealzy/)
 * (@zealzy)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/multiple-fields-in-print-function/#post-13986813)
 * 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](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/multiple-fields-in-print-function/#post-13986913)
 * Hello [@zealzy](https://wordpress.org/support/users/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](https://wordpress.org/support/users/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](https://wordpress.org/support/users/zealzy/)
 * (@zealzy)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/multiple-fields-in-print-function/#post-13992491)
 * 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](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/multiple-fields-in-print-function/#post-13992960)
 * Hello [@zealzy](https://wordpress.org/support/users/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.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form](https://wordpress.org/plugins/calculated-fields-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/calculated-fields-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/calculated-fields-form/)
 * [Active Topics](https://wordpress.org/support/plugin/calculated-fields-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/calculated-fields-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/calculated-fields-form/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [codepeople](https://wordpress.org/support/users/codepeople/)
 * Last activity: [5 years, 3 months ago](https://wordpress.org/support/topic/multiple-fields-in-print-function/#post-13992960)
 * Status: resolved