-
1. Re: Can I have one check box that checks a suite of other check boxes?
dcidev Apr 16, 2014 8:35 AM (in response to Westicles)Try this:
for (var a=0;a<YourSubform.nodes.length;a++){ vNode=YourSubform.nodes.item(a); if (vNode.className=="field" && vNode.ui.oneOfChild.className=="checkButton" && vNode.parent.className!="exclGroup"){ vNode.rawValue=this.rawValue; } }Where 'YourSubform' is the name of the subform with the checkboxes. Also, all On/Off values under the Binding tab must be the same.
Kyle
-
2. Re: Can I have one check box that checks a suite of other check boxes?
Westicles Apr 16, 2014 8:54 AM (in response to dcidev)Can you include an image of the form that this was being used in? Not sure what is part of the script and what is unique to the form it was used in
This is how I want it to work where if any of the top boxes are checked, then the boxes directly beneath them will be checked as well. My binding names are ASSAY_D for the top "assay box" and ASSAY_1 beneath it and ASSAY_2 beneath that, etc.
-
3. Re: Can I have one check box that checks a suite of other check boxes?
dcidev Apr 16, 2014 9:08 AM (in response to Westicles)Are all the checkboxes under the same subform?
Kyle
-
4. Re: Can I have one check box that checks a suite of other check boxes?
Westicles Apr 16, 2014 9:11 AM (in response to dcidev)Yep
-
5. Re: Can I have one check box that checks a suite of other check boxes?
dcidev Apr 16, 2014 9:22 AM (in response to Westicles)Put this in the change event (JavaScript) of all your 'Check All' boxes:
var suffix=/[^_]+/.exec(this.name); var i=1; while (xfa.resolveNode(suffix+"_"+i)!=null){ xfa.resolveNode(suffix+"_"+i).rawValue=this.rawValue; i++; }Kyle
-
6. Re: Can I have one check box that checks a suite of other check boxes?
Westicles Apr 16, 2014 9:59 AM (in response to dcidev)Cool that worked, kinda. I got the following result
So, as you can see, it worked for two full comlumns and almost a full column for the third. However, 3 of them did not work at all. the binding names for the ones that did not work are THN_SEC_1, THN_SEC_2, etc. I have a feeling that the underscore in the binding name messed it up. I can remove the underscores but I would prefer not to. Any other way?
-
7. Re: Can I have one check box that checks a suite of other check boxes?
dcidev Apr 16, 2014 10:43 AM (in response to Westicles)Do all the top checkboxes end with _D ?
Kyle
-
8. Re: Can I have one check box that checks a suite of other check boxes?
Westicles Apr 16, 2014 10:45 AM (in response to dcidev)Yep
-
9. Re: Can I have one check box that checks a suite of other check boxes?
dcidev Apr 16, 2014 11:13 AM (in response to Westicles)Try this:
var suffix=/(\w+_)D$/.exec(this.name)[1]; var i=1; while (xfa.resolveNode(suffix+i)!=null){ xfa.resolveNode(suffix+i).rawValue=this.rawValue; i++; }Kyle
-
10. Re: Can I have one check box that checks a suite of other check boxes?
Westicles Apr 16, 2014 11:16 AM (in response to dcidev)It worked. Wow how can I thank you enough!? I am very thankful for your help, Kyle.
Cheers,
WES
-
11. Re: Can I have one check box that checks a suite of other check boxes?
Westicles Apr 16, 2014 11:36 AM (in response to dcidev)What if I want to continue onto the next page with this script. As in...
Can I remove the "Check All"s from the second page and have the script from the first continue to these check boxes somehow? This is asking alot but you have been so helpful so far. They have continued suffix (as in page 1 ends with ASSAY_13 and page 2 starts with ASSAY_14)
-
12. Re: Can I have one check box that checks a suite of other check boxes?
dcidev Apr 16, 2014 12:23 PM (in response to Westicles)Try this on for size:
var vNodes=this.parent.parent.resolveNodes('#subform[*].#field.(this.name.substr(0,this.name.length-1)=="'+this.name.substr(0,this.name.length-1)+'")'); for (var a=0;a<vNodes.length;a++) vNodes.item(a).rawValue=this.rawValue;Kyle
-
13. Re: Can I have one check box that checks a suite of other check boxes?
Westicles Apr 16, 2014 12:28 PM (in response to dcidev)That one only filled down 9 boxes
-
14. Re: Can I have one check box that checks a suite of other check boxes?
dcidev Apr 16, 2014 12:49 PM (in response to Westicles)Say Yes to the JavaScript
var vNodes=this.parent.parent.resolveNodes('#subform[*].#field.(this.name.indexOf("'+this.name.substr(0,this.name.length-1)+'")!=-1)'); for (var a=0;a<vNodes.length;a++) vNodes.item(a).rawValue=this.rawValue;Kyle
-
15. Re: Can I have one check box that checks a suite of other check boxes?
Westicles Apr 16, 2014 12:54 PM (in response to dcidev)You are a wizard. Thanks so much
-
16. Re: Can I have one check box that checks a suite of other check boxes?
Westicles Apr 16, 2014 12:57 PM (in response to dcidev)I would also like to have one box that adds up the values of multiple boxes on multiple pages. The boxes to be added have the binding name INTVL_1, INTVL_2, INTVL_3, etc.
On a side note, where do you learn scripting like this?
-
17. Re: Can I have one check box that checks a suite of other check boxes?
dcidev Apr 16, 2014 1:21 PM (in response to Westicles)Sorry, you've reached your daily limit ; )
In all seriousness though, start a new thread for the addition question.
You can learn about SOM predicates in the XFA Specification or
http://blogs.adobe.com/formfeed/2008/10/data_binding_with_predicates.html
Bruce BR001 really opened my eyes to the power of predicates with his search function http://forums.adobe.com/thread/518910
Kyle




