Expand my Community achievements bar.

SOLVED

Check one box to check multiple boxes

Avatar

Former Community Member

I have created a javascript so that one checkbox will check multiple boxes.

if

(this.rawValue==1)

{button1.rawValue

=1};

if

(this.rawValue==0)

{button1.rawValue

=0};

The problem is that I have about 15 of these "Check all" checkboxes to create and around 24 buttons underneath each one.

Is there a better way to script the check all button, maybe something that will check all the boxes in a subform?

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

You could something like this...

check_all.PNG

Steve

View solution in original post

2 Replies

Avatar

Correct answer by
Former Community Member

You could something like this...

check_all.PNG

Steve

Avatar

Former Community Member

Ok, in the test I ran, this worked. But there is a catch.

My checkboxes are named things like AEMN, AEMP, CALF, CILCO and the such. What i would do is rename these in the Hierarchy to CB_AEMN, CB_CALF.  is there a wildcard that can be put on the cb to pick up the changes?

xfa.resolveNode("page1.subform1.cb["

+ i + "]").rawValue =1;

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----