• Resolved mpbaweb

    (@mpbaweb)


    Hi
    Is it possible to control the display of the submit and captcha fields depending on a form field.
    For example, I ask a simple yes/no question at the very beginning of the form and if the user replies ‘Yes’, none of the fields are displayed except a text field which tells the user he must use a different form with a hyperlink. However, the Submit button and captcha are still visible. I want to only show these if the user selects ‘No’

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @mpbaweb,

    The fields your are referring (the captcha and submit button) cannot be defined as dependents, but you can show/hide them programmatically.

    – Insert a “HTML Content” field in the form, and enter the following piece of code as its content:

    
    <script>
    jQuery(document).on('change', '[id*="fieldname57_"]', function(){
    var action = 'show';
    if(jQuery('[id*="fieldname57_"]:checked').val()=='Yes') action = 'hide';
    jQuery('.captcha,.pbSubmit')[action]();
    });
    </script>
    

    and that’s all.
    Best regards.

    Thread Starter mpbaweb

    (@mpbaweb)

    Perfect!
    The support for this plugin is absolutely first class!

    @codepeople
    I want it on the reverse mode, I mean, id a field is checkmarked, then it shows the submit button.

    I tried to replace ‘show’ and ‘hide’ but didn’t work

    Plugin Author codepeople

    (@codepeople)

    Hello @amirdorna,

    If you want show a submit button when a checkbox or radio button is checked, the process is very straightforward:

    – Select the “No” option for the attribute: “Display submit button?” in the form’s settings.

    – Insert a button in the form, and convert it in a submit button entering as its onclick event, the piece of code:

    
    jQuery(this.form).submit();
    

    – Select the radio button or checkbox field in the form, and then, click on the link: “Show dependencies” in its settings (specifically in the choices section)

    – And finally, select the button field from the list of dependent fields corresponding to the choice.

    Best regards.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Conditionally hide Submit button’ is closed to new replies.