Add Instance

In the first image below the user can click on "AC" to add additional lines for comments. When they have completed that they will click on "Add Line" to add a new instance of that line. In the 2nd image the 2nd line is overwritting the additional comments add to the 1st line. How do I position line two and additional lines to occur at the bottom of the additional comments (1 comment or 5+)
Also I need two more buttons
     1. Will add line and copy the contents of the line above
`    2. Move line - Up and Down button that will allow the user to reorder the entries.
Thanks in advance for your help!

Hi,
The example has several tables, the last two have add, remove buttons, as well as move button and button to add rows directly underneath (add instance and move it in one click).
There is an example I did here for someone. https://acrobat.com/#d=HD6XJ1qofZDf713Yq1P43g. From memory the add instance script also copied the rawValue of the "Send to" object to the "Reviewer" object in the new instance. This should give you a direction.
When it comes to LiveCycle Designer there is no single source with all of the information. Some of the Adobe resources are extremely valuable, but do not make for light reading.
A good book to start out with is JP Terry's book on LC Designer, which is excellent - "Creating Dynamic Forms with Adobe LiveCycle Designer".
We have some solutions and blog posts on our website http://www.assuredynamics.com. We are trying to make some of examples more instructional. Also if you go to the blog on our site you will see some other blogs that we strongly recommend.
There is also a range of online resources. You may find these resources helpful:
http://www.adobe.com/go/learn_lc_scriptingBasics
http://www.adobe.com/go/learn_lc_scriptingReference
http://www.adobe.com/go/learn_lc_formCalc
http://www.adobe.com/devnet/livecycle/articles/Adobe_XML_Form_Object_Model_Reference.pdf
http://www.adobe.com/devnet/acrobat/pdfs/lc_migrating_acrobat_xmlform. pdf
And a very handy resource (and while it is for version 6 it is still very good because of the way it is laid out):http://partners.adobe.com/public/developer/en/tips/CalcScripts.pdf
The help file also helps with syntax and LC Designer comes with templates/examples.
Lastly, check out the Developer's Network on http://www.adobe.com/devnet/livecycle/
Also a book that doesn't deal with scripting at all but is very good on form layout is "Forms that Work" by Caroline Jarrett and Gerry Gaffney.
The Adobe "PDF Forms Bible" is okay, but mainly focuses on AcroForms.
Windjack Solutions have a subscription based service for solutions and scripts at http://www.pdfscripting.com. It has a lot of AcroForm script that can be amended to suit LC Designer and a growing library of LC Designer solutions.
Hope that helps,
Niall

Similar Messages

  • Calculation in an add instance

    I am trying to use an if statement in an addinstance of an interactive form.  Based on the results of one field in the addinstance, I want to sum a different field from the add instance.  So, the customer can add any number of rows and choose from a drop down (coded 1-4) the position of the person.  If that position is 1 or 2, I want to sum the salary field in a calculation box.  If the position is 3, then I want to sum the salary(ies) in a second calcuation box, and if the position is 4, then I want to sum the salaries in a third calculation field.  My code for one of the the calculation field looks like this:
    form1.#subform[8].#subform[9].details.total.conditions.#subform[0].numTotal[
    1]::calculate - (FormCalc, client)
    if (detail[*].PTFT < 3) then
          Sum(detail[*].salary)
          endif
    The other two fields are the same except that they change "<3" to "==3" or "==4". 
    The problem is that it does not sum the second or third calcuation field.  Only my first calcuation field will work. 
    Since it is a rather simple if statement, I think that the problem may be in the subforms, possibly?
    Please see my form at http://www.units.muohio.edu/lifelonglearning/forms/zzztest.pdf
    Thanks in advance for any help you can lend.

    Ok I had a look at your form (nice form by the way ...good job). The expression you are using to determine the number of instances is not correct....as well when you sum the salaries it is the details subform that has th eiccurance numbers so that needs the * notation. Here is the 1st calc modified
    if  (details._detail.count < 3) then
         Sum(detail[*
    ].salary) 
    endif
    You also have the same code on the layout ready and the calc event. No need for both ...just leave it on the calc event and when the user enters the amounts the totals will update.
    You are also getting an error when the row initialize .....a partNoScript is being called becuase of script behind the Name field (itis called txtPartNo in your form). My guess is that you copied this from the Purchase Order sample and forgot to remove the scritp from the Initialize and the change event. This field was originally a DD field and that is what was used to populate it.
    Hope that helps
    Paul

  • Add instance on Read only field issue

    I have a subform with two fields , one a date field to capture current system date and time and another is a Text field for some comments.
    Then there are two buttons ,one for Adding the instance for these two fields and another is a Save button which makes these two fields
    The requirement is that once both the fields are filled with data and i click on save button, the fields should become read only ,however when i click on the add instance button the instance is added successfully but the save button click is not making the new instance read only.
    The Code for Add Instance Button is :
    "New1.FileNote.instanceManager.addInstance(true);
    xfa.form.recalculate(true);"
    The code for Save button to make the fields read only is :
    New1.FileNote.DateTimeField101.access = "readOnly";
    New1.FileNote.TextField37.access = "readOnly";
    Please guide me as I am totally blank on how to code the same..Have a rough logic of using a for loop with index of the Add Instance but not getting the way out for the code.
    Thanks a lot for any help and guidance.

    Hi Steve,
    Thanks for your reply..I made it happen using the for loop with Index and resolve node. However there is another issue which occured after that..I have a date/time field in that repeating subform instance.
    The run time property is set to Current Date/Time. Now the issue is whenever i click on save, form.recalculate instance changes the existing time value in the previous subbform instance as well
    Is there a way to retain the existing value in the field of the previous instance ??
    Regards
    Kapil

  • Add instance in a subform which also can be doubled

    Hi,
    I have a subform X which can be doubled by a click on the button. In that subform X there is another subform Y which also can be multiplied to a maximum of 3.
    Now when I add a subform X and i want to add some subforms Y. The form will only add the subform Y in the first subform X and not in the second one.
    This is the script I use:
    for subform x
    if(Incitant52.subFoireAcheteur.all.length < 2){;
    Incitant52.subFoireAcheteur.instanceManager.addInstance(true);
    and for subform y
    if(Incitant52.subFoireAcheteur.subAcheteur.all.length < 3){;
    Incitant52.subFoireAcheteur.subAcheteur.instanceManager.addInstance(true);

    To add instances to the second occurance of subform x you will need to address it with subformx[1].
    Note that the [ ] brackets are not valid in javascript so your expression should look something like this:
    xfa.resolveNode("Incitant52.subFoireAcheteur.subformx[1]").instanceManager.addInstance(1)

  • Add Instance Subform content to textbox

    Hi all,
    There is sth I would like to do.
    I have a form which has a text field that is in a subform where you can add instances. No problem with pages etc.
    Now, I have created a text field where I would like all entries to be repeated as plain text possibly separated by rows.
    For example:
    Textbox in Subform: Eggs
    Textbox 2 in Subform (after clicking the add instance button): Butter
    Text box at the end should either say:
    Eggs, Butter
    or
    Eggs
    Butter
    Does anyone have an idea on how I can achieve this?
    Thanks a lot,
    Larissa

    Hi Paul,
    Actually I have several requirements. I have attached the pdf as this seems easier at this point.
    At the beginning of the pdf, I have the marks in three boxes. I would like to concatenate them with a comma between the different entries into a text field that users can then copy paste into the next form.
    Let’s say in the first box you put:
    A
    B
    C
    In the second,
    D
    E
    I would like to have a text box that comes out as: A,B,C,D,E
    Second problem I am facing with this task is at the countries.
    I have a country online selection and a second country selection.
    Ideally I would like to have just one box with all countries and be able to tell the pdf that certain countries have the characteristic “Online”.
    Thus if the client clicks on “Add” I would have two list boxes: One for Online and one for Rest. Depending on what the characteristic of the country it would either go into the Online or the Other.
    Any ideas on my problematic.
    I was thinking working with numbers and maybe telling the system that if it is under 100, move to Box 1, if it is over 100, move to Box 2.
    Thanks for your help.
    Kind regards,
    Larissa

  • Need help with add instance

    I'm can't figure out how to add a new record with add instance, see below for basic code.  The second one works but I can't re-create it.  I'm guessing something basic that I am over looking.
    I also can't figure out how to attached my pdf's so you have to download from my website.
    Thanks,
    Jay
    http://www.atg.state.vt.us/assets/files/Adding%20a%20row%20-%20does%20not%20work.pdf (does not work - need help)
    http://www.atg.state.vt.us/assets/files/Adding%20a%20row%20-%20works.pdf (this one works - I didn't create it)

    It looks as if you have saved the form as an Acrobat 7 STATIC form....you
    need to save it as a DYNAMIC form.  You will find that option in the file
    types in the save as dialogue.  I resaved it locally and your form works.
    Hope this helps

  • Adding add instance into calculation

    I am trying to get  fields  from  add instance/subform fields to calculate with the rest of the form fields. The problem I am having is once I "add instance" the field is no longer part of the calculation. I have tried using:// Verify at least one instance of the midtr3a field exists.
    if 
    (exists(location.yes900.admids.midtr3a) == 1) then
    Sum(location.yes900.admids[
    *].midtr3a)
    endif
    would appreciate any help on this.
    Thanks K

    I think you do not have to check for whether the field exists or not..Because when you use the "Sum" function, it will check if the field is present and if it has value or not.
    You may directly try the following int he script..
    Sum(location.yes900.admids[*].midtr3a
    Also in your Exists function, you are checking "exists(location.yes900.admids.midtr3a)".. This will only check for the first instance of the field.
    Thanks
    Srini

  • Can't Add instance code

    I am working on a flash file AS2 that contains some combo
    boxes.
    When I start the program I can right click on a button and
    add instance code ie current selection is the button.
    After working on the file for a while I can't do this.
    When I right click on new buttons and objects and select
    actions the current selection shows as the frame not the
    object I want to add code too.
    This is very frustrating as I basically can't add instance
    code.
    Any help would be greatly appreciated
    Alfred

    I think the problem was the pin current script button. Some
    how I clicked this and no matter what I right clicked on it would
    always take be to the last script I used before I hit the button.
    Thanks for your prompt response.
    Alfred

  • Ciscoworks 4.0, netconfig job, add instance problem

    I'm trying to make an adhoc job to some devices in ciscoworks.  I select netconfig jobs, select the devices I want to do a change to, and then select add instance, I get a new browser window saying loading and nothing more happens.
    I cannot create the config lines I want to perform to my switches.  I just want to change the vtp domain name to the switches, but cannot do this due to the blank browser window saying loading.
    Anyone know anything about this?
    Br
    Geir

    I just updated my LMS 4.0 device packages, and I cannot reproduce.  I then noticed your SharedNetconfigIOS.zip package is larger than mine.  I suspect it's corrupt.  Go to Admin > System > Software Center > Device Update, check the boxes next to Common Services and Inventory Config And Image Management and download and install all available packages.  If none are available, you will need to contact TAC to get an up-to-date package repository to correct this problem.  You can click the "Open Service Request" link in the Actions panel of this thread to capture everything we've done here if you have to open a service request.

  • Add Instance variable

    1.
    Can we add instance variables to an existing standard agent
    e.g. can we edit the metadata file for an UNIX host (default agent installation which OEM provides) and add owr own variable ?
    2.
    How do we edit and add the values under "Target Properties" for each agent. Couldn't find a Save button...The following properties look empty and just wondering how do we add them ?
    Comment
    Line of Business
    Deployment Type
    Location
    Contact
    Thank you

    I dont understant what you say 'instance variables'
    Provide me what are your problem or what do you need
    Regards
    PD: The target properties of a host or database can edit with grid control console or if you edit the targets.xml file
    the agent properties also can edit if you modify the emd.properties

  • For Statement on a table using add.instances - need help

    Hi,
    I made this table in an acrobat form.   The table uses java script to add rows .   The code I used is:
    _detail.addInstance(1);
    There are two fields on this table that I want to evaluate 1)  an index named index1    
    and 2) the value named numAmount
    The script I am using to evaluate these to fields is as follows:
    if (form1.Page1.Subform1.Capital1.Capital1.detail.index1.rawValue ==2)
        then
        $.rawValue = form1.Page1.Subform1.Capital1.Capital1.detail.index1.numAmount.rawValue 
        endif
    My problem is that I need to nest this if statement inside some kind of a loop.    I want the program to look at my table, determine how many instances the user has added,  scroll through the table and look at index1,  if index 1 = 2 then i want it to return the value in numAmount.
    I just can't get the syntax to work in either form calc or javascript.
    I am trying to write this code using the calculate method on a fourth field located on form1.#subform[2].Table5.Row5.NumericField1
    I have attached the file if it helps.   The table is on page one of the form and the display field is on page three. 
    Any help would be much appreciated!!!

    This is an Acrobat Forms JavaScripting forum, you might find more help in one of the LiveCycle Designer forums.

  • Subforms within subforms add Instance problem

    Hi
    I am new to Adobe Livecycle Designer (I am using version 8.2.1) but I have successful made nearly all elements of the quite long form I need to produce except for one section I am having difficulty getting it to function correctly. In the example I have a repeating subform ‘Organisation’ on page subform ‘Membership’ which has buttons to add and remove instances, which work correctly. But within each instance of this ‘Organisation’ subform is another repeating instance subform ‘ExpertNames’ with buttons to add and remove instances.
    The ‘Organisation’ form allows an organisation to be named and the ‘ExpertNames’ subform allows multiple members for that organisation to be named and associated to each organisation. The user should be able to list multiple organisations each with one or more members. I can successfully add multiple instances of ‘Organisation’ form one after another using
    Membership.Organisation.instanceManager.addInstance(1)
    and remove the selected instance using
    Membership.Organisation.instanceManager.removeInstance(this.parent.index)
    I have the following set on the button to add a new instance of the ‘ExpertNames’ form
    Membership.Organisation.ExpertNames.instanceManager.addInstance(1);
    and the following to remove the selected instance of the 'ExpertNames' form
    Membership.Organisation.ExpertNames.instanceManager.removeInstance(this.parent.index);
    However when I add a second instance of the ‘Organisation’ form i.e. a new organisation and try and add additional members to the 2nd organisation it adds them to the 1st organisation rather than the second! I have an example of the problem form i can send if needed.
    Hope someone will be able to help with this.
    Many thanks in advance
    Lara

    I still have not been able to find a solution to this does anyone have any ideas?
    I have an example of the problem in a form that I can email.
    Many thanks in advance
    Lara

  • Add Instance Tabbing

    Is is possible to control the tabbing order of a dynamically created addInstance subform? The main form has tabbing set, but the properties don't seem to carry over to the newly created instance. I've read a post or two on the topic but was curious of the procedure to fix it or work around it.
    Thx a ton!!

    I am trying to build a form used for Arabic Language (Arabic Language is Right to Left).
    When I am applying form fields it is assignig Tab sequence from Left to Right. Is it possible to add the Tab sequence from Right to Left

  • Add instance question

    Hi,
    In my PDf I need to add and remove subform instances dinamically.
    I only have/need one subform. This subform has a multi line text field and 2 buttons: add and delete instance. So everytime I create a new instance, I will get a text filed with 2 buttons.
    My first requesite was to be able to delete any of the previous created instances. I figured out this using: this.parent.index in the deleted instance.
    However, in what regards to creating new instances, I would like also to create each instance, not after all the other previuos created instances, but right after the instance where the button was clicked.
    Example:
    Initial case:
    instance 1
    instance 2
    instance 3
    I need to be able to create a new instance, for example, between instance 1 and instance 3.
    instance 1
    instance 2 (new)
    instance 3
    instance 4
    Is this possible?
    Thank you!

    You need to invoke the moveInstance method to move the newly created subform instance from the bottom of the list to under the current instance where the button was clicked.
    There is some sample code on page 676 of the Adobe XML Form Object Model Reference.
    Regards,
    Chris

  • Add instance before existing instance

    Hello all,
    is there a way to add a new instance of a Subform to show in a top the existing subform? the way it works now when you add a click on button to add a subform, the new subform shows under the exisitng subform and so forth, every time I add a subform it goes to the bottom. I want the opposite to happen where new subforms, always show in the top of old subforms.

    It depends on where you want the subform to actually go.
    Suppose you have a button inside a subform and you always want the new subform to go on top of the entire stack of subforms:
    this.parent.instanceManager.insertInstance(0);
    If you want to add it right above whatever instance you're working on, then this code will work:
    this.parent.instanceManager.insertInstance(this.parent.index);
    Note: You'll need to add or remove reference points depending on what you're using to trigger the event, of course.

Maybe you are looking for