These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Help for Livecycle virgin

Djbower1
Registered: Apr 12 2009
Posts: 5

Hi all.

I have only been using Livecycle for around 48 hours so please be nice ;)

I have created a form which nearly works...

I have created a instance to add rows as required and this work fine but in the last column I have a Drop Down box. Within the box I have two option.

When I select option 1 in the drop down box I want it to make visible a text box. if I select option 2 in the list I want it to make another text box visible.

so far I have the following

---------------------------------------------------------------------------------------------------------------------------------

form1.Page2.Section8.Table3.Row1.DisposalList::change - (JavaScript, client)

if (this.xfa.event.change == "Option1") {

Section9.option1text.presence = "visible";
}
else {
Section9.option1text.presence = "hidden";
}
if (this.xfa.event.change == "Option2") {

Section10.option2text.presence = "visible";
}
else {
Section10.option2text.presence = "hidden";
}

--------------------------------------------------------------------------------------------------------------------------------

One of the problems I'm having is when I add a new row to the table with the instance button and then select option 2 when the first row id option 1 it overrides the first text field.

As i said... I don't really have a clue what I'm doing....

I think it could be something to do with it thinking that all the drop down list are the same as they are created using instances.

Any help would be greatly appreciated.

Thanks,

Dan

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
It's all about the structure of your form. As long as the text box and the drop down are inside the same subform (assuming it's the repeated subform) , the the code can use a relative path from the dropdown to the text box. This relative path will only reference the local text box.

Have you seen this video?
https://admin.adobe.acrobat.com/_a200985228/p87746471/

You'll also find several video tutorials and example PDFs on this very topic at www.pdfscripting.com

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

Djbower1
Registered: Apr 12 2009
Posts: 5
Hi, Thanks for your reply.

the text box is in a different subform. it there any way to make this work.

Would it better to make a whole subform hidden/visible instead? if it is even possible.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Yes, you could make the whole subform invisible. But, if you are trying to control a single text field from multiple places you have a problem, i.e., which dropdown has control.

I would stronly suggest you watch the videos before moving on. They will explain a lot.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script