LiveCycle Designer ES4 and JavaScript



Hello Everyone,

I am usually pretty good at figuring these things out, but I am not sure what to do.  I am trying to get a button in LiveCycle to run a JavaScript which will add a text box.  Essentially, the user will click the button if they need to write additional comments.  It would take a while to explain why I need this, but suffice it to say that we are trying to save room on the form.  I am putting in the following into a Script Object:

var g=this.getField("txt1-3-1");

if ( g==null ) {


var myRect=f.rect;

var deltaX=-18;

var deltaY=-60;

var widthTxt=60*3;

var heightTxt=3*12;





var f=this.addField("txt1-3-1", "text", this.pageNum, myRect);



f.value=" ";


} else this.removeField("txt1-3-1");

This coding works perfectly in eCopy PDF Pro Office.  Button is created, everyone is happy. Technically what is happening is when I go to the button to add an action I have the condition set to when button is clicked.  When I go to the result however, I click on "Call Script Object".  I click "object", click the appropriate item.  Then it says "function" with a drop down menu next to it.  Nothing is ever in the drop down menu. I know it must be some formatting thing I am doing wrong, but I don't know.  Any guidance or suggestions would be appreciated.  Thanks for any thoughts.

Accepted Solutions (0)

Answers (3)

Answers (3)



There are a number of tutorials out there that should help get you started. Here's one I picked at random: Adding Rows and Showing Optional or Alternative fields in LiveCycle Designer - YouTube

The second part is most relevant to your current issue. You'll find others out there, and there's good information about creating dynamic form in the LiveCycle Designer documentation. If you get stuck, just post another question here. Good luck.



Hello George,

I am trying to create a dynamic form.  Essentially, I need a form that flows and expands as information is put into it, as well as buttons that add text fields that can be typed in.  Ideally, the button would create a text field inside a subform that flows and would then push everything else down.  I just taught myself JavaScript and was able to get this code to work in another program.  It would figure I wouldn't be able to use that in this program   Any suggestions or thoughts that could push me in the right direction?  Anything would be appreciated.  Thanks.




That code would make sense for an AcroForm, but not an XFA form created in LiveCycle Designer, which has a completely different object model. Are you creating a static or dynamic form in LiveCycle Designer?