Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author donmik

    (@atallos)

    You need to use javascript. I don’t know another way to achieve what you want.

    Something like this:

    <script>
        jQuery(function($) {
            subQuestionsShowHide();
            $('.editfield').on('change', 'input[name=field_184]', function() {
                subQuestionsShowHide();
            });
    
            function subQuestionsShowHide() {
                if ($('input[name=field_184]:checked').val() === 'YES') {
                    $('.field_187').show();
                } else {
                    $('.field_187').hide();
                }
            }
        });
    </script>

    Replace “input[name=field_184]” 184 with the ID of your question field ID.
    Replace “$(‘.field_187’)” 187 with the ID of your subquestion field ID.
    You can add more lines like “$(‘.field_187’).show();” and “$(‘.field_187’).hide();” if you have more than one subquestion.

    Thread Starter samueluwawah

    (@samueluwawah)

    Alright thanks, i guess i will have to leave the job like that without adding it, or try another plugin since i don’t know anything about JavaScript. Or do i have any other option?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How do i create optional Yes or No sub-questions in the profile fields’ is closed to new replies.