Hi all! I am stuck and would love a little help. I have a form with about 5 levels of subforms. I'm trying run a script with a button click that loops through each subform and hides any subforms that contain an unchecked Checkbox. Here is my hierarchy:
So far, I've created a script object called "hide" that has this:
function ToggleRows(reset){
var Rows = form1.page1.middle.ADDITIONS.EMR.Checkboxes.cb.all;
var curRow;
for (var i=0; i<Rows.length; i++){
curRow = Rows.item(i);
if (curRow.cb.rawValue == 1){
curRow.presense = "hidden";}
else{
curRow.presense = "visible";}
}
}
My button is in the "top" subform, and contains this text:
hide.ToggleRows(reset);
Any guidance on this would be greatly appreciated!
Solved! Go to Solution.
Views
Replies
Total Likes
Hi
As well as the presense thing, what is reset. You pass it in but never use it. Try just hide.ToggleRows();
Views
Replies
Total Likes
Hi,
Is this the problem? There is a typo in your code:
presense should be presence
Views
Replies
Total Likes
Oh good catch! Made that correction, but unfortunately no...still not working.
Views
Replies
Total Likes
Just some thoughts....
You could also try specifically naming your subforms rather than using the autonumbering when the same name is used. I found that the number in square brackets in an object name interfered with the reference to an instance which is also a number in square brackets.
Eg: instead of cb[1], have cb1 etc
Using resolveNode has also fixed some issues i have had as well with subforms.
Views
Replies
Total Likes
Hi
As well as the presense thing, what is reset. You pass it in but never use it. Try just hide.ToggleRows();
Views
Replies
Total Likes
Removing "reset" appears to have fixed it! Thank you both for all your help!
Views
Replies
Total Likes
Good news. Make sure you have "Show console on errors and messages" set in Acrobat, under Edit ... Preferences ... JavaScript as you should have seen a "reset is not defined" message
Views
Replies
Total Likes
Good tip. You can also show the console any time by pressing CTRL+J
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies