Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

hiding unchecked checkboxes

Avatar

Former Community Member

Created form utilizing table format,.  Form consist of 18 rows. Below is a sample of my form

form.jpg

Here is my scipt on the show checked items button

script.jpg

All works fine until  I decide to add another text row between a text row and checkbox row.  sample below.

Text.jpg

Now when I click the show checked items, everything works fine until I reach this new text.  Then it ignores my script and show the items that are checked and unchecked.  By inserting this line, it seems to throw off my script.  What do I need to do? Below are my results.

Test 2.jpg

1 Reply

Avatar

Level 8

Here is a script you can try:

for (var i=0;i<Table1.QuestionRow.all.length;i++){

var oQuestion=Table1.QuestionRow.all.item(i);

var oAnswer=Table1.AnswerRow.all.item(i);

if (oQuestion.CheckBox.rawValue==0){

  oQuestion.presence="hidden";

  oAnswer.presence="hidden";

}

}

Name all your question rows (Row3) 'QuestionRow' and all your text fields (Row4) 'AnswerRow' and name all your checkboxes 'CheckBox'.

Kyle