Script to add a new page in LiveCycle

I am new to LiveCycle so please forgive my ignorance. I have 2 things I am trying to do.
1. In my fillable form, I want to have default text in the the form field that appears in light gray and disappears automatically when a user clicks in the field to enter text. I know how to add a default but then my user would have to erase the default to add their own information. I don't know if this is an easy thing or if it needs scripting.
2. I created a button and I want to add JavaScript to it to have it copy the second page of my form and add it as a third page to be filled out too. I don't want to send a form with a bunch of extra pages so I want my users to create new pages as necessary. I know how to view the script editor and I added some script, but it doesn't appear to be correct as I don't get the green or red icons to attach the script to the button and when previewed, the button does nothing. I chose on Click and I understand that the script creates a path to my object with a period in between each object, but I don't understand after the instanceManager.addInstance(true) what I should put. What does the "true" part mean. I thought that I would put the name of the object that I wanted added. Am I close to doing this right or is it much more complicated? Does my button have to be in a subform with the objects or something to work? Am I trying to do something that is possible?
I wish I could printscreen to this forum.

For each of the fields that you like to have default value displayed and get cleaned on entry you can have following JS script in "enter" event....
if (this.rawValue == "<default value for that particular field>") {
     this.rawValue = ""
and for "exit" event....
if (this.isNull) {
     this.rawValue = "<default value for that particular field>"
Hope tha helps with the first issue....
And with the second question you had....yes it is some thing that can be done with few tricks and little script.
Your button does not need to be part of that subform...and noting wrong even if it is.
instanceManager.addInstance(true)     //true is part of syntax however following example can give you better idea
_secondPageSubForm.addInstance(true) is what you would use in "click" event of the button where "secondPageSubForm" is your subform name to repeat and designed to fit entire page so you can continue adding entire page rather than part of page. And "_" (Underscore) is part of the syntax to recognize the repeating subform.
And to whole thing work as expected you need to save/render PDF as Dynamic template and set your "secondPageSubForm" as repeating in "Binding" tab.
Hope that helps, Good Luck,

Similar Messages

  • Need to add a new page in the SAP Script as last page

    Hello,
    I need to add a new page in the SAP Script as last page.
    Currently I have three pages in the form(FIRST,NEXT,LAST). For this I created one more page END.
    FIRST page next page is NEXT
    NEXT page next page is NEXT
    LAST page next page is LAST
    END page next page is END.
    I used NEW-PAGE END in the main window but it is not working and also I trired with CONTROL_FORM this also not working.
    Thanks,
    Ravi.

    Hello,
    I need to add a new page in the SAP Script as last page.
    Currently I have three pages in the form(FIRST,NEXT,LAST). For this I created one more page END.
    FIRST page next page is NEXT
    NEXT page next page is NEXT
    LAST page next page is LAST
    END page next page is END.
    Create the text element in the main wondow of your form
    /E           ENDPAGE
    /:           NEW-PAGE END
    and call the element from your print program by using write_form, where you want the END page in your print.
      CALL FUNCTION 'WRITE_FORM'
        EXPORTING
          element = 'ENDPAGE'
        EXCEPTIONS
          element = 1
          window  = 2.
    Thanks,
    Ravi.

  • Pages 5.0 won't let me add a new page to a 13 page document.

    Since updating to Pages 5.0, I have not been able to add anymore pages to a 13 page document I am working on for an art project. The document uses original photographs as a background and a text box over them for the text. In the "Insert" drop down box in the tool bar, everything is grayed out. The program will also not let me copy and paste any of the previous pages so I can't even add a new page that way. I've also just looked to see if there were any restrictions on the file on the "Get Info" menu from the Finder, it still had the file as anyone can read and write to the file, so it can't be that either. I was wondering if anyone else has had a similar issue, and if so, how they managed to work around it?
    Thanks in advance!

    Sorry to be "that guy", but i've done that without an issue, I can now add pages by copying previous ones, but now Pages 4.3 groups a new page which is blank, with page 13. It also adds a the copy of the last page below the two that get grouped together.  So basically, I end up with 2 copys of page 13, and the original.

  • I have a Wordpress site. I wanted to add a new page to it. However, when I try, I am able to type inside of the "Title" box & I am able to type inside of the

    I have a Wordpress site. I wanted to add a new page to it. However, when I try, I am able to type inside of the "Title" box & I am able to type inside of the "Post Excerpt (Meta Description)" box. However, I cannot type inside of the main body box where the actual content of my page would appear.
    This seems to be a browser issue because I can do it if I use Internet Explorer. Why does Firefox prevent me from editing or adding a new page to my Wordpress site?
    Thanks.

    Hi,
    try
    help -> restart with add-ons disabled.
    Regards
    '''Deepak Krishnan P.R'''

  • Need to add a new page 1 to a completed form

    I have a 4 page form that was completed. Now I need to add a new page 1 with information in text fields. When I insert a page it is inserted as the last page. I then move the page in the Hierarchy to the correct position and get 2 blank pages. When I try to delete the first one, I'm told there is no subform so the page cannot be deleted and the command is ended.
    Thanks,
    MDawn

    Hi,
        I think I found the issue with the form..you can confirm..
        For the page/ Subform "GuestSysAccessReq" you selected "Following Previous", for "Place" under Pagination tab. And rest of the Pages/ subforms you selected "Top of Next Page" as a value for "Place". And again at the end for "guidelines" page you selected "Top of Page -> Page1" as a value for "Place".
       I corrected all the pages/ subforms to have the same value for the "Place" field as "Top of Page -> Page1" and then I added a new page and I could able to move the page to be the first page in the heirarchy. It did not add an empty page.. I am attaching the modified frm in the forum for your reference..
       Let me know if you have any issues.
    Thanks
    Srini

  • Why Can't I Add a New Page To My WP Site?

    I have a Wordpress site. I wanted to add a new page to it. However, when I try, I am able to type inside of the "Title" box & I am able to type inside of the "Post Excerpt (Meta Description)" box. However, I cannot type inside of the main body box where the actual content of my page would appear.
    This seems to be a browser issue because I can do it if I use Internet Explorer. Why does Firefox prevent me from editing or adding a new page to my Wordpress site?
    Thanks.

    No. I cannot even get the flashing cursor to appear in that box.

  • How to add a new page to a streaming portal?

    I want to add a new page to a streaming portal.
    I add a new page to the .portal file on my desktop development
    environment.
    I do a build, creating a new ear with an updated .portal file on it.
    I deploy that ear, but I do not see the page in the library.
    I found that if I create a new Desktop, based off the .portal file, the
    page is added to the library (as well as every other desktop).
    Is this the right way to do things? Or do I have to add the page using
    the admin tool? If I do, I don't have access to all the properties.

    Once you create desktop from a template (.portal) file built in workshop, all the elements of the portal template file get stored in database as library resources. Later when you add new pages to the .portal file, you wont see those changes in the streaming mode desktop. As far as I know, BEA is trying to fix this issue in future releases. But in the meanwhile, you have to create a new .portal file in workshop and create desktop out of it from admin portal to see the new changes.
    Seenu.

  • Cannot add a new page to iWeb

    Already made some iWeb sites, but can't add a new page anymore. Any idea?

    NOTE : I'm not using iWeb '08 but the late one (iWeb '09 v.3.0.3)
    Also, just realized I can still duplicate pages (once modified, they resulted in the new needed pages), so iWeb is not completely useless yet…
    But stil no "new page" or "new site" working command/menu/icon

  • Web Dynpro Java WIki - Not able to add a new page.

    Hi Experts,
                     I want to add a new wiki page in Web Dynpro Java, but i am not able to find corresponding button or action  to create a new page.Please guide me to add a new page.
    Thanks and Regards
    Fazal Ahamed

    Hi Fazal,
    This is probably due to the Expert Wki which was launched last week. Please see Craig's blog for more details: /people/community.user/blog/2009/06/17/welcome-the-expert-wiki
    BR,
    Hilit

  • Can I add a new page to both phone and desktop in the same respective location? Can this only be done manually?

    It appears that once you create your phone site, from that point on, when I add a new page to one layout or the other, the "Page/go to same" command struggles. Can I create a new page and have it automatically create a matching placeholder page on the alternate format/site plan?

    Hi
    To answer your query, I am afraid you cannot add a new page to both phone and desktop in the same respective location. You need to manually do the same.

  • Livecycle: Is there a way to add a new page by choosing what kind of page from a drop down menu

    I am creating a form to be used for patient care,
    I have multiple pages, the first is an information page, second is an evaluation page, the third is a treatment page.
    I am hoping to add a drop down menu (Add New Page) with the following in it:
    1. Treatment Note
    2. Discharge Summary
    3. Treatment Order
    4. Progress Note
    Each of the selections corresponds to a specific page layout.
         ie:  1.  Vitals, signature, etc.
               2. Previous information compared to current status
              3.  Ordering equipment etc.
              4. Updating referral source.
    I am new to this so any help is appreciated, assume I know very little to begin with so specifics on how to create your recommendations are greatly appreciated.
    Cheers

    The attached contains a drop-down that sets focus on a text field on the applicable page. The effect is to navigate to the page. The exit event looks like this...
    //form1.page1.subform1.pageSelection::exit - (JavaScript, client)
    switch (this.rawValue) {
    case "Treatment Note":
       xfa.host.setFocus(form1.page2.subform1.someField);
       break;
    case "Discharge Summary":
       xfa.host.setFocus(form1.page3.subform1.someField);
       break;
    case "Treatment Order":
       xfa.host.setFocus(form1.page4.subform1.someField);
       break;
    case "Progress Note":
       xfa.host.setFocus(form1.page5.subform1.someField);
       break;
    default:
       break;
    There are a variety of ways this could be accomplished.
    Steve

  • How can I create a form with a button that adds a new page of fields to fill out?

    Hi,
    I have a one-page form created in Acrobat Pro 9 that contains five fields for a user to complete. I'd like to give the user the option of adding a page with the same five fields to fill out. The user finishes those fields, presses an "Add a Page" button, and then gets another page to fill out, and so on. When finished, their PDF form might be 10 pages long, at which point the user can save it as a single PDF file. Is this possible to do in Acrobat Pro 9 or 10, and if so, how?
    Thanks,
    Andrew

    When I created a new template like you told me, I wasn't given the option to rename the fields. See screenshot below. I'm just given the option to add a new template. Changing it refers to changing the template to a different page.
    If you can show me how to have the fields renamed automatically or use the rename parameter, I think that should fix it.
    Under Tools>JavaScript>Document JavaScripts, I've added a Script named "PackagingArtwork".
    // Here is the code
    function PackagingArtwork()
    {this.createTemplate({cName: "PackagingArtwork", nPage: 5});
    // Here the code that spawns the template
    var PackagingArtworkArray = this.templates;
              var PackagingArtwork = PackagingArtworkArray[0];
              PackagingArtwork.spawn(this.numPages, false, false);
    This is what the JS debugger said.
    Acrobat EScript Built-in Functions Version 10.0
    Acrobat SOAP 10.0
    var t1 = createTemplate("t1", 0);
    var oXO = t1.spawn({nPage: numPages, bOverlay: false});
    while (numPages < 50) {
        t1.spawn({nPage: numPages,  bOverlay: false, oXObject: oXO});
    undefined
    [object CosObj=<<Stream>>]
    TypeError: PackagingArtworkArray is null
    2:Field:Mouse Up
    TypeError: PackagingArtworkArray is null
    2:Field:Mouse Up
    TypeError: PackagingArtworkArray is null
    2:Field:Mouse Up
    TypeError: PackagingArtworkArray is null
    2:AcroForm:Duplicate Packaging Artwork:Annot1:MouseUp:Action1
    TypeError: PackagingArtworkArray is null
    2:Field:Mouse Up
    TypeError: PackagingArtworkArray is null
    2:Field:Mouse Up
    TypeError: PackagingArtworkArray is null
    2:Field:Mouse Up
    TypeError: PackagingArtworkArray is null
    2:AcroForm:Duplicate Packaging Artwork:Annot1:MouseUp:Action1
    TypeError: PackagingArtworkArray is null
    2:AcroForm:Duplicate Packaging Artwork:Annot1:MouseUp:Action1
    TypeError: PackagingArtworkArray is null
    2:AcroForm:Duplicate Packaging Artwork:Annot1:MouseUp:Action1

  • How do i add a new page to my already existing pages template document?

    help i'm really confused and in a hurry! I am working on something using a template, but it doesn't have enough pages, but i can't add a new one.

    whoops sorry figured it out thanks!

  • How can i change the background color in the heading when i add a new page

    How can I change the background in the heading on a new page? When you add WELCOME page the heading color is tan, the ABOUT ME page the heading is light blue, the PHOTOS page the heading block behind the heading text is light green, etc. How do I change those colors?

    you can change iweb navbar any which way you want, as long as you know iweb widgets:
    http://iwebwidgets.cyclosaurus.com/iWebNavBar/BkgndColor.html
    you won't see the change in iweb, you only see it in published site.

  • Coldfusion CMS add a new page

    Hi, I want to create a simple CMS site using coldfusion. I would like to have an 'add new page' button which will create a new html or coldfusion page and show the name of that page in the navigation bar as a link, can someone point me in the right direction of a tutorial or give me a clue to what code I should be using. I'm fairly new to Coldfusion and programming so any help would be much appreciated!!!
    many thanks

    One thing to consider before embarking on this sort of exercis is that you're setting out on well-trod ground.
    Are you sure you want to be writing your own CMS when there are a number of well-established and free ones already out there?
    Looking at FarCry or Mura would be my first step in any enterprise like this.
    Adam

Maybe you are looking for