AnsweredAssumed Answered

Javascript On Repeating Section

Question asked by jpayne on Oct 18, 2017
Latest reply on Jan 5, 2018 by emha

Hi,

i am new to JavaScript and am trying to find a way to do a select all on a Choice Control that is in a repeating section.

I have it working for only the first row if you add another row the button doesn't work for the second row. Is there a way to have a select all for all the choice buttons in the repeating section not just the first row?

 

Here is my javascript code that works for the first row

function selectAll()
{NWF$("#" + Site).find(":checkbox[value='ALB']").attr("checked",true);
NWF$("#" + Site).find(":checkbox[value='ECH']").attr("checked",true);
NWF$("#" + Site).find(":checkbox[value='OCA']").attr("checked",true);
NWF$("#" + Site).find(":checkbox[value='HDQ']").attr("checked",true);
NWF$("#" + Site).find(":checkbox[value='AUR']").attr("checked",true);
NWF$("#" + Site).find(":checkbox[value='MTC']").attr("checked",true);
NWF$("#" + Site).find(":checkbox[value='HAM']").attr("checked",true);
NWF$("#" + Site).find(":checkbox[value='WCW']").attr("checked",true);
NWF$("#" + Site).find(":checkbox[value='BAR']").attr("checked",true);
NWF$("#" + Site).find(":checkbox[value='CLE']").attr("checked",true);
NWF$("#" + Site).find(":checkbox[value='HER']").attr("checked",true);
NWF$("#" + Site).find(":checkbox[value='BRN']").attr("checked",true);
NWF$("#" + Site).find(":checkbox[value='DEC']").attr("checked",true);
NWF$("#" + Site).find(":checkbox[value='LVC']").attr("checked",true);
NWF$("#" + Site).find(":checkbox[value='CHA']").attr("checked",true);
NWF$("#" + Site).find(":checkbox[value='DEN']").attr("checked",true);
NWF$("#" + Site).find(":checkbox[value='MID']").attr("checked",true);
}

Attachments

Outcomes