I feel like I am going crazy,
I have a check box and a table on a LiveCycle PDF Form, when I select the checkbox I want a table to appear, and when unticked, disappear.
I have simplified the document to show CheckBox1 (Checkbox from Standard menu) and Table1 (Table from Standard menu), I have enabled javascript in the scripting window for all events on the change event for the checkbox entered the following code
if(this.rawValue == 0){
form1.Table1.presence = "hidden";
} else {
form1.Table1.presence = "visible";
}
If I set the initialize script to
form1.Table1.presence = "hidden";
The table is not visible as expected but the checkbox method does nothing... I've watched a video on YouTube and followed every last detail, even copying his example and my system does nothing!!! arghhhghhghghgh...
What have I missed? Thanks,
Solved! Go to Solution.
Thanks everybody, for all the tutorials I read and watched everyone failed to mention file types before they got started.
My form was set to STATIC, meaning it would render only once, my code was good but the page simply doesn't rerender so it would appear to do nothing. The dynamic parts, or the inputs of fields appear to be the only things affected on static forms hence the behaviour I mention in one of my previous comments.
I had previously tried a dynamic form which didn't work either but needed to do the following setting changes to get it working...
Then fix your preview in LiveCycle
And bingo... Hope this helps some other noob. Thanks again Broklynite alassir
Hi bozely,
try this:
if (this.rawValue == "1") {
this.resolveNode("Table1").presence = "visible";
} else {
this.resolveNode("Table1").presence = "hidden";
Regards
Dietmar
Views
Replies
Total Likes
Thanks Alassir, although, your suggestion did not resolve the issue. I've got a feeling this is a set up issue, the code is stock. I'm reading the manuals and have plenty of other code working but this just doesn't want to work.
Views
Replies
Total Likes
Hi Bozely,
the code is working on my machine - no clue why it doesn't work on yours.
Which LC Version are you using?
Best
Dietmar
Views
Replies
Total Likes
Hi Dietmar,
I'm currently using LiveCycle 8.0.
Currently this code will only work when in the initialised event, if it is placed in any other event it doesn't fire. I do not understand why...
this.presence = "hidden";
Thanks again for your assistance.
Views
Replies
Total Likes
Ok, if I add a TextField and fill it with some text and run my code the check box will hide and unhide the text inside the textbox, I couldn't see this as the textbox I using was blank (doh!).
But I want to hide the whole object... How to do this?
Thanks,
Views
Replies
Total Likes
bump
Views
Replies
Total Likes
Going out on a limb here, I admit. You said that you've set it to hidden in the initialize event, while the rest of this is in the change event. Just on the off chance, have you tried doing the following:
1. comment out the hidden code in the initialize event
2. select the table in the object hierarchy.
3. Object tab - Subform tab - Presence, select Hidden
I'm absolutely not a programmer, I'm just a guy who has been flailing at this stuff for a couple of months now. I've tended to notice that the software isn't always happy about multiple state declarations that are mutually exclusive. So by setting it to hidden by default rather than having it be visible by default and then subsequently commanding it to be hidden and then commanding it to be visible...
Look, I know it's stupid, and it shouldn't work that way. But it will take two seconds to try. If it doesn't work, what have you really lost?
Views
Replies
Total Likes
Thanks everybody, for all the tutorials I read and watched everyone failed to mention file types before they got started.
My form was set to STATIC, meaning it would render only once, my code was good but the page simply doesn't rerender so it would appear to do nothing. The dynamic parts, or the inputs of fields appear to be the only things affected on static forms hence the behaviour I mention in one of my previous comments.
I had previously tried a dynamic form which didn't work either but needed to do the following setting changes to get it working...
Then fix your preview in LiveCycle
And bingo... Hope this helps some other noob. Thanks again Broklynite alassir
great you got it working - and thanks for posting the solution
Views
Replies
Total Likes
Views
Likes
Replies