Title: Custom error conditional logic not working
Last modified: July 8, 2019

---

# Custom error conditional logic not working

 *  Resolved [matt453654645](https://wordpress.org/support/users/matt453654645/)
 * (@matt453654645)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/custom-error-conditional-logic-not-working/)
 * Hi,
 * Im trying to use the conditional logic section in contact for 7 redirection to
   make a field required sometimes, based on the value of another field.
 * I have set up redirection with condition logic and its works perfectly, and although
   the custom error works, it ignores the conditional logic and always validates
   the field regardless of what i enter in the conditional logic section.
 * My form looks like the below, im trying to get it to only require business-name-
   pop-up
    if the business tab has been picked.
 * Any help would be appreciated, thanks
 * <div id=”repair-form” class=”on-pop-up”>
    <script>
 *  function setRepairFor(){
 * var toggle = document.getElementById(‘repair_toggle_pop_up’);
    var input = document.
   getElementsByName(‘repair-for-pop-up’)[0]; var business_input = document.getElementsByName(‘
   business-name-pop-up’)[0]; var business_postcode = document.getElementsByName(‘
   business-postcode-pop-up’)[0]; if(input.value == ‘Home’){ toggle.children[0].
   className = ”; toggle.children[1].className = ‘on’; input.value = ‘Business’;
   business_input.className = ‘ps-custom-input’; business_postcode.className = ‘
   ps-custom-input’; }else{ toggle.children[0].className = ‘on’; toggle.children[
   1].className = ”; input.value = ‘Home’; business_input.className = ‘ps-custom-
   input none’; business_postcode.className = ‘ps-custom-input none’; }
 *  }
    </script> <h4 class=”ps-custom-header”>Get a Repair Estimate</h4>
 * <div class=”ps-custom-toggle”>I need a repair for my
    <div class=”toggle” onclick
   =”setRepairFor()” id=”repair_toggle_pop_up”> <div class=”on”> Home </div> <div
   > Business </div> </div> [hidden repair-for-pop-up “Home”] </div> [text business-
   name-pop-up class:ps-custom-input class:none placeholder "Business Name"]
 * [text business-postcode-pop-up class:ps-custom-input class:none placeholder "
   Site Postcode"]
 * [text* first-name class:ps-custom-input placeholder “First Name”]
 * [text* last-name class:ps-custom-input placeholder “Last Name”]
 * [email* your-email class:ps-custom-input placeholder “Your Email Address”]
 * [tel* your-number class:ps-custom-input placeholder “Contact Phone Number”]
 * [textarea* repair-description class:ps-custom-input x4 placeholder “Describe 
   the Repair”]
 * [mfile repair-image-pop-up id:multi_file_custom_pop_up class:ps-custom-input]
 * [submit class:submit-button-form “Get an Estimate”]
 * [response]
 * </div>
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcustom-error-conditional-logic-not-working%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Contributor [Yuval](https://wordpress.org/support/users/yuvalsabar/)
 * (@yuvalsabar)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/custom-error-conditional-logic-not-working/#post-11710348)
 * [@matt453654645](https://wordpress.org/support/users/matt453654645/),
 * This support forum is only for the free version. For the pro support you need
   to [submit a ticket](https://querysol.com/submit-ticket-2/) and one of our developers
   will be happy to help 🙂
 * Yuval.
 *  Thread Starter [matt453654645](https://wordpress.org/support/users/matt453654645/)
 * (@matt453654645)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/custom-error-conditional-logic-not-working/#post-11710797)
 * ok, i will do that, thanks.

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

The topic ‘Custom error conditional logic not working’ is closed to new replies.

 * ![](https://ps.w.org/wpcf7-redirect/assets/icon-256x256.gif?rev=3416723)
 * [Redirection for Contact Form 7](https://wordpress.org/plugins/wpcf7-redirect/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpcf7-redirect/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpcf7-redirect/)
 * [Active Topics](https://wordpress.org/support/plugin/wpcf7-redirect/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpcf7-redirect/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpcf7-redirect/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [matt453654645](https://wordpress.org/support/users/matt453654645/)
 * Last activity: [6 years, 11 months ago](https://wordpress.org/support/topic/custom-error-conditional-logic-not-working/#post-11710797)
 * Status: resolved