I'm using the code from the Branching question submitted in the Question Library to hidde/show a question based on the answer to another question on the same page:
https://www.sawtoothsoftware.com/community-question-library/1731-branching
In my case, Q2 needs to be shown if Q1=3. That works well. The problem is that Q2 is automatically required, even if it is hidden, so if Q1<3, I get an error on the page and I can't proceed.
The question library notes say: Custom JavaScript verification can be used to make questions require a response only if shown. This code may help you get started:
$('#[% QuestionName() %]_div').is(':visible');
I added that code to the Custom JavaScript verification window for Q2, but I still get the error. I need Q2 to be required, only when shown. What am I missing?