Expand my Community achievements bar.

Where to place JavaScript to access fields throughout entire form?

Avatar

Former Community Member
Hello,



I am having troubles figuring out where to place my JavaScript code. I have a 2 page PDF with 4 different parts and I want to keep track of what Part is currently being worked on.



A user fills out Part 1, submits, then part 2, submits, etc. etc. (that coding is all done, I am using servlet and Forms for that). Each time the form loads, I set a text field to Part1, Part2, etc. (this is also finished using PDFMerge and Forms). Next is where I need to incorporate the JavaScript to read that value and depending on that value hide/show buttons. So, where I am getting confused is, I can access the rawValue within the page initialize event (and also for that control's initialize event), but I can then not figure out how to access controls on the other page. I've tried placing my code within root initialize event and get nowhere. I have a feeling I am just not referencing things correctly, since it seems to make sense to place the code within my root initialize event. I have tried the xfa resolveNode and specifying just the nodename and .rawValue = "blah". I've also tried not even using resolveNode, just the field name with rawValue.



Thanks!

Jennifer
1 Reply

Avatar

Former Community Member
Oy, why is it everytime I waste hours upon hours trying to figure something out, then I post a question here and figure it out like 5 minutes after I post the question? :-)



So I need to specify pageNum.subformName.FieldName.rawValue = "blah"; I put this is in my root initialize event. I guess this should be the correct place? I think it should work now.



Thanks,

Jennifer