Title: Conditional fields for File Attachments
Last modified: April 12, 2019

---

# Conditional fields for File Attachments

 *  Resolved [triggerbox](https://wordpress.org/support/users/triggerbox/)
 * (@triggerbox)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/conditional-fields-for-file-attachments/)
 * Good day,
 * I have a similar issue than the users in another post ([https://wordpress.org/support/topic/conditional-field-for-file-attachments/](https://wordpress.org/support/topic/conditional-field-for-file-attachments/)),
   whereby it was stated it was fixed but I cannot get it to work.
 * Here is my code in the email form:
 *     ```
       <label> Your Name (required)
           [text* your-name] </label>
   
       <label> Your Email (required)
           [email* your-email] </label>
   
       <label> Subject
           [text your-subject] </label>
   
       [checkbox* product-info "Product 1" "Product 2" "Product 3"]
   
       [group group-products-1]You selected <strong>Product 1</strong>[/group]
       [group group-products-2]You selected <strong>Product 2</strong>[/group]
       [group group-products-3]You selected <strong>Product 3</strong>[/group]
   
       <label> Your Message
           [textarea your-message] </label>
   
       [submit "Send"]
       ```
   
 * And here is the code for the email:
 *     ```
       From: [your-name] <[your-email]>
       Subject: [your-subject]
   
       Product Info: [product-info]
   
       [group-products-1]You selected Product 1[/group-products-1]
       [group-products-2]You selected Product 2[/group-products-2]
       [group-products-3]You selected Product 3[/group-products-3]
   
       Message Body:
       [your-message]
       ```
   
 * And for the File Attachments section:
 *     ```
       [group-products-1]
       uploads/2019/04/product-1.pdf
       [/group-products-1]
       [group-products-2]
       uploads/2019/04/product-2.pdf
       [/group-products-2]
       [group-products-3]
       uploads/2019/04/product-3.pdf
       [/group-products-3]
       ```
   
 * It ignores the conditions and just attaches all 3 files. Please advise.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fconditional-fields-for-file-attachments%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * (@jules-colle)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/conditional-fields-for-file-attachments/#post-11430129)
 * could you try with the last update? Version 1.4.3? I thought it was fixed before
   but it wasn’t. Should be okay now. Both your examples should work.
 *  Thread Starter [triggerbox](https://wordpress.org/support/users/triggerbox/)
 * (@triggerbox)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/conditional-fields-for-file-attachments/#post-11430766)
 * Hi Jules, I already have Version 1.4.3 installed and it is still not working.
 *  Plugin Author [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * (@jules-colle)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/conditional-fields-for-file-attachments/#post-11461707)
 * still not working? Did you check for typo’s? What is the resulting email you 
   get if you add this in the email body?
 *     ```
       [group-products-1]
       uploads/2019/04/product-1.pdf
       [/group-products-1]
       [group-products-2]
       uploads/2019/04/product-2.pdf
       [/group-products-2]
       [group-products-3]
       uploads/2019/04/product-3.pdf
       [/group-products-3]
   
       [group-products-1]You selected Product 1[/group-products-1]
       [group-products-2]You selected Product 2[/group-products-2]
       [group-products-3]You selected Product 3[/group-products-3]
       ```
   
 *  Thread Starter [triggerbox](https://wordpress.org/support/users/triggerbox/)
 * (@triggerbox)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/conditional-fields-for-file-attachments/#post-11465872)
 * Hi Jules,
 * Your snippet works in the email body, here is the full contents of the email,
   when I only select one product:
 *     ```
       uploads/2019/04/product-1.pdf
   
       You selected Product 1
       ```
   
 * It still attached **all three** PDFs though. Here is the file attachment again:
 *     ```
       [group-products-1]
       uploads/2019/04/product-1.pdf
       [/group-products-1]
       [group-products-2]
       uploads/2019/04/product-2.pdf
       [/group-products-2]
       [group-products-3]
       uploads/2019/04/product-3.pdf
       [/group-products-3]
       ```
   
 *  Plugin Author [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * (@jules-colle)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/conditional-fields-for-file-attachments/#post-11465924)
 * Could you try to put:
 *     ```
       [group-products-1]uploads/2019/04/product-1.pdf[/group-products-1]
       [group-products-2]uploads/2019/04/product-2.pdf[/group-products-2]
       [group-products-3]uploads/2019/04/product-3.pdf[/group-products-3]
       ```
   
 *  Thread Starter [triggerbox](https://wordpress.org/support/users/triggerbox/)
 * (@triggerbox)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/conditional-fields-for-file-attachments/#post-11465975)
 * With your code above there were ZERO attachments.
 * I selected the same product 1. here is the email body output again:
 *     ```
       uploads/2019/04/product-1.pdf
   
       You selected Product 1
       ```
   
 *  Plugin Author [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * (@jules-colle)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/conditional-fields-for-file-attachments/#post-11495355)
 * I checked this several times now on my own installation, and it all works fine.
   Could you try and set up a fresh WP installation with only CF7 and Conditional
   fields plugin installed, and try there? I’m kind of clueless on what could be
   causing this to malfunction on your site. The only thing I can think of is a 
   theme or plugin conflict.

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

The topic ‘Conditional fields for File Attachments’ is closed to new replies.

 * ![](https://ps.w.org/cf7-conditional-fields/assets/icon-256x256.png?rev=2072595)
 * [Conditional Fields for Contact Form 7](https://wordpress.org/plugins/cf7-conditional-fields/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cf7-conditional-fields/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cf7-conditional-fields/)
 * [Active Topics](https://wordpress.org/support/plugin/cf7-conditional-fields/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cf7-conditional-fields/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cf7-conditional-fields/reviews/)

## Tags

 * [email](https://wordpress.org/support/topic-tag/email/)

 * 7 replies
 * 2 participants
 * Last reply from: [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * Last activity: [7 years, 1 month ago](https://wordpress.org/support/topic/conditional-fields-for-file-attachments/#post-11495355)
 * Status: resolved