• Resolved michaeldesiteq

    (@michaeldesiteq)


    I want the visitor to be able to click on a button and then only a subset of questions is shown. So let’s say there are two buttons. If the visitor clicks on button 1, only questions 1-4 are shown. When the visitor clicks on button 2, questions 5-8 should be shown. The calculated field (let’s say fieldname9) should always be visible and be updated based on the input for questions 1-8.

    Is it somehow possible to show and hide specific questions, specifying it via the shortcode? Or are there other methods to achieve this?

    Thanks in advance!

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

    (@codepeople)

    Hello @michaeldesiteq

    Yes, that’s possible. Please, follow the steps below:

    1. Insert two DIV fields in the form. I’ll assume their names are fieldname1 and fieldname2. Note that you should use the names of the fields in your form.

    2. Insert into fieldname1 the fields corresponding to the first group of questions and the second group of questions into fieldname2.

    3. Now, insert the pair of buttons outside the DIV fields. Enter the following piece of code as the on-click event of the first button to activate the first questions block and disable the second:

    ACTIVATEFIELD('fieldname1');IGNOREFIELD('fieldname2');

    And enter the following piece of code as the on-click event of the second button to disable the first questions group and enable the second one:

    IGNOREFIELD('fieldname1');ACTIVATEFIELD('fieldname2');

    The calculated field would be outside the DIV fields too.

    4. Finally, insert an “HTML Content” field in the form to disable both DIV fields by default, with the following piece of code as its content:

    <script>
    fbuilderjQuery(document).one('showHideDepEvent', function(){
    IGNOREFIELD('fieldname1');
    IGNOREFIELD('fieldname2');
    });
    </script>

    Best regards.

    Thread Starter michaeldesiteq

    (@michaeldesiteq)

    @codepeople Cool, I’ll try that, thanks! I assume this also works in addition to the WooCommerce add-on? So to add this form setup to product pages and add the products with calculated prices to the shopping cart?

    Plugin Author codepeople

    (@codepeople)

    Hello @michaeldesiteq

    Yes, of course. But please, for questions related with commercial features is necessary you contact us through the plugin website: Contact Us

    Best regards.

    Thread Starter michaeldesiteq

    (@michaeldesiteq)

    @codepeople apologies, will do. Thanks for your help!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Shortcode to specific questions’ is closed to new replies.