Title: Conditional and required fields
Last modified: May 17, 2018

---

# Conditional and required fields

 *  Resolved [lilu04](https://wordpress.org/support/users/lilu04/)
 * (@lilu04)
 * [8 years ago](https://wordpress.org/support/topic/conditional-and-required-fields/)
 * Hello,
    It is there a possibility to create conditional fields and to be required.
 * For example, I have a dropdown and when someone selects something appears different
   fields. But if I put one conditional field required it becomes required for all
   the options.

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

 *  [meneeroom](https://wordpress.org/support/users/meneeroom/)
 * (@meneeroom)
 * [8 years ago](https://wordpress.org/support/topic/conditional-and-required-fields/#post-10333632)
 * I am also having this issue.
 * It seems like this issue is being ignored due to many requests over 4 months 
   ago.
 * I will check it out to see if we could perhaps remove the “required” attribute
   with jQuery
 * Please advise?
    -  This reply was modified 8 years ago by [meneeroom](https://wordpress.org/support/users/meneeroom/).
 *  [meneeroom](https://wordpress.org/support/users/meneeroom/)
 * (@meneeroom)
 * [8 years ago](https://wordpress.org/support/topic/conditional-and-required-fields/#post-10333739)
 * A temporary fix for the issue:
 * When Option 1 is selected, the corresponding “show” field will be cleared, and
   the hidden required field will be set to N/A. When the user selects Option 2,
   the related field will then be cleared and the other field will be set to N/A
 *     ```
       <script type="text/javascript">
           jQuery(document).ready(function($){
              $('input:radio[name="billing_myfield12"]').change(
                 function(){
                     if ($(this).val() == "Option 1") {
                         // alert('Option 1');
                         $('#billing_myfield15').val("");
                         $('#billing_myfield16').val("N/A");
                     }
                     else if ($(this).val() == "Option 2"){
                         //alert('Staff Account');
                         $('#billing_myfield15').val("N/A"); 
                         $('#billing_myfield16').val("");             
                     }
                 }
             );
           });
        </script>
       ```
   
    -  This reply was modified 8 years ago by [meneeroom](https://wordpress.org/support/users/meneeroom/).

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

The topic ‘Conditional and required fields’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-checkout-manager/assets/icon-256x256.jpg?rev
   =2911736)
 * [Checkout Field Manager (Checkout Manager) for WooCommerce](https://wordpress.org/plugins/woocommerce-checkout-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-checkout-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-checkout-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-checkout-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-checkout-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-checkout-manager/reviews/)

## Tags

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

 * 2 replies
 * 2 participants
 * Last reply from: [meneeroom](https://wordpress.org/support/users/meneeroom/)
 * Last activity: [8 years ago](https://wordpress.org/support/topic/conditional-and-required-fields/#post-10333739)
 * Status: resolved