2) Add the following script to the source of the multiple choice question. Replace "QQ" with the multiple choice question question ID.

The script initially hides the last number of rows defined by the "hideNum" variable. If the Attribute 1 token equals "x", the rows are shown.

<script type="text/javascript" charset="utf-8">
$(document).ready(function(){// The question ID and number of rows to be hiddenvar qID = QQ;var hideNum =3;var listLength = $('#question'+qID+' li[id^="javatbd"]').length;// Loop through the options and hide the last n
$('#question'+qID+' li[id^="javatbd"]').each(function(i){if(i >= listLength - hideNum){
$(this).addClass('dynamic').hide();}});// Show the last n rows if token value is correctif('{TOKEN:ATTRIBUTE_1}'=='x'){
$('.dynamic').show();}});</script>

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

As you can see, there are 2 question groups which are called Name and Address, because if some specific tokens are not present in the token table (which are imported through an xml file, and the token content varies), I don't want to present the whole table, as the first Name and Address group. Therefore I have a second Name and Address with less token information.

And here is where I would like to use a javascript method instead.

Rajan

PS: I am good with CSS, but javascript is above my current knowledge. So if it is complicated, I am open to hire your programming skills to help me with this...?

We're working on a generic, non-JavaScript-dependent, solution to issues like the one you've described. Please comment on this thread if there is functionality we've missed.

The way I've tackled this sort of thing in the past was to:
(1) Show a table of the data I had, as separate questions with a template to make it look like a table, and use check box (as you have done) to let users indicate they needed to edit it
(2) One next page (group), only display value-correction boxes for fields that were either missing or flagged as needing to be fixed on prior page
(3) Make the sub-questions conditional on the other entered values. I've never had access to Matrix-style questions before, so I'm still learning the nuances of their conditional display, but sounds like there would be demand for such a feature.

1) Add token-related classnames to all of the relevant table rows in Q1. So the source of Q1 should look something like this:

2) Wrap all of the Q2 sub-questions in spans with token-related classnames. So they should look something like this:

3) Add the following script to the source of the group description. The script assigns the span classnames to their parent list item(row) and then checks the values of the relevant token attributes. If an attribute is found empty, the corresponding rows in Q1 and Q2 are hidden.

<script type="text/javascript" charset="utf-8">
$(document).ready(function(){// Add a class to all of the multi-opt rows
$('.multiple-opt-comments li[id^="javatbd"] .option label span').each(function(i){
$(this).parents('li:eq(0)').addClass($(this).attr('class'));});// And now a bunch of ugly conditionalsif(!'{TOKEN:FIRSTNAME}'){$('.FIRSTNAME').hide();}if(!'{TOKEN:LASTNAME}'){$('.LASTNAME').hide();}if(!'{TOKEN:EMAIL}'){$('.EMAIL').hide();}if(!'{TOKEN:ATTRIBUTE_2}'){$('.ATTRIBUTE_2').hide();}if(!'{TOKEN:ATTRIBUTE_3}'){$('.ATTRIBUTE_3').hide();}if(!'{TOKEN:ATTRIBUTE_4}'){$('.ATTRIBUTE_4').hide();}if(!'{TOKEN:ATTRIBUTE_5}'){$('.ATTRIBUTE_5').hide();}if(!'{TOKEN:ATTRIBUTE_6}'){$('.ATTRIBUTE_6').hide();}if(!'{TOKEN:ATTRIBUTE_7}'){$('.ATTRIBUTE_7').hide();}if(!'{TOKEN:ATTRIBUTE_8}'){$('.ATTRIBUTE_8').hide();}if(!'{TOKEN:ATTRIBUTE_9}'){$('.ATTRIBUTE_9').hide();}if(!'{TOKEN:ATTRIBUTE_10}'){$('.ATTRIBUTE_10').hide();}if(!'{TOKEN:ATTRIBUTE_11}'){$('.ATTRIBUTE_11').hide();}if(!'{TOKEN:ATTRIBUTE_12}'){$('.ATTRIBUTE_12').hide();}if(!'{TOKEN:ATTRIBUTE_13}'){$('.ATTRIBUTE_13').hide();}if(!'{TOKEN:ATTRIBUTE_14}'){$('.ATTRIBUTE_14').hide();}if(!'{TOKEN:ATTRIBUTE_15}'){$('.ATTRIBUTE_15').hide();}});</script>

Here is a copy of your survey with the changes described above applied to the group I've renamed "Name and Address 2". You will find the JavaScript in the group description source. In this group I also modified the conditions on Q2 a bit to show the question appropriately (copied all Q1 questions to Q2 and added "if Q1 = No" o each scenario).

I have made no changes to the "Name and Address 1" or any other groups.

limesurvey_survey_64197_TONY.lss

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.