PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Hide the SUBMIT button conditionally - Revisited

  1. I found this closed thread and was able to get the submit button hidden, unfortunately I'm stuck at trying to figure out how to get it back when the item is selected.

    http://forum.gravityhelp.com/topic/hide-the-submit-button-conditionally

    I'd like to know what I need to do to correct this and for future reference, if my sample code is correct (based on craiger's) where I find the input id to return the submit button (I've replaced the input id with question marks - where I think he element I'm missing is). I also tried using Kevin's sample and it had the same problem.

    Below is the code I'm using - the URL of the form is located:
    http://www.saeler.com/contact-us

    I disabled the script, until I can resolve the issue

    <script type="text/javascript">
    
    jQuery(document).ready(function(){
           jQuery("#input_2_8").click(function(){ToggleButton();});
           ToggleButton();
    });
    
    jQuery(document).ready(function(){
           jQuery("#input_2_29").click(function(){ToggleButton();});
           ToggleButton();
    });
    
    function ToggleButton(){
           var display = "block";
           if(jQuery("#input_2_8").val() == "Select One...")
                   display = "none";
           else if(jQuery("#input_2_8").val() == "Maintenance / Support Request")
                   display = "none";
           else if(jQuery("#input_2_8").val() == "General Questions / Comments")
                   display = "none";
           else if(jQuery("#input_2_8").val() == "Advertising / Joint Venture Offer")
                   display = "none";
    
           jQuery(".button").css("display", display);
    }
    
    </script>
    Posted 13 years ago on Monday December 6, 2010 | Permalink
  2. Hi Sahdow, which file did you place your javascript code into? Is this code on the live site you provided?

    Posted 13 years ago on Monday December 6, 2010 | Permalink
  3. Conditional logic was functionality for the submit button was built into the plugin in version 1.3.1 - you shouldn't need to implement this script now. This was a workaround before that functionality was introduced into the core.

    You'll find the conditional logic options for the button along with the normal button settings in the advanced tab of the main form settings panel.

    screenshot: http://grab.by/7LfY

    Posted 13 years ago on Monday December 6, 2010 | Permalink
  4. O.k. Got it. Weird though yesterday when I posted this, the option was grayed out, which is why I tried to use the above option. Perhaps another part of the form needed to be completed first. I created the fields before anything else.

    Posted 13 years ago on Tuesday December 7, 2010 | Permalink
  5. The conditional logic requires you to have a select (drop down) field, checkbox or radio (multiple choice) field in your form for it to hinge on. If you don't have any of those type fields, the option would be grayed out.

    Posted 13 years ago on Tuesday December 7, 2010 | Permalink