Title: Required fields
Last modified: July 9, 2018

---

# Required fields

 *  Resolved [murillobv](https://wordpress.org/support/users/murillobv/)
 * (@murillobv)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/required-fields-44/)
 * Hello,
    I have three fields in my product page. One for the customer send me 
   a photo. (upload field) One for the customer send me a code for a photo. (text
   field) An one select field for choose witch one of these two options. The thing
   is that is mandatory one of the two options but not the two at the same time.
   I wrote a javascript to hide the upload field and show the text field when the
   user select to send me the code, and vice versa. In this javascript I also tryed
   to change the ‘wccpf-mandatory’ attribute of those fields when I hide or show,
   but seems that the plugin read the mandatory fields from other place (perhaps
   the admin page). Is it possible to do what I need??? Thank you in advance.

Viewing 1 replies (of 1 total)

 *  Thread Starter [murillobv](https://wordpress.org/support/users/murillobv/)
 * (@murillobv)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/required-fields-44/#post-10477401)
 * Well.
    I already figure out. I create a new validation before add to cart in 
   the functions.php file.

Viewing 1 replies (of 1 total)

The topic ‘Required fields’ is closed to new replies.

 * ![](https://ps.w.org/wc-fields-factory/assets/icon-128x128.jpg?rev=2738843)
 * [WC Fields Factory](https://wordpress.org/plugins/wc-fields-factory/)
 * [Support Threads](https://wordpress.org/support/plugin/wc-fields-factory/)
 * [Active Topics](https://wordpress.org/support/plugin/wc-fields-factory/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wc-fields-factory/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wc-fields-factory/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [murillobv](https://wordpress.org/support/users/murillobv/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/required-fields-44/#post-10477401)
 * Status: resolved