Clear fields when PDF page is spawned?

Hi all,
I have a fillable PDF  form that has buttons at the top of every page for the user to  duplicate the page in case more information needs to be entered.  Here  is the javascript I'm using, courtesy of George Johnson:
// Get a template object from an existing template
var t = getTemplate("myTemplate");
// Spawn the template on the page following this one, and rename the fields
t.spawn({nPage: pageNum + 1, bRename: true, bOverlay: false});
This  works great, except when the user has already filled out page 1, then  clicks the button to duplicate the page, the new page contains the  information already filled in by the user on page 1.  Is there a way to  clear the fields when the page is duplicated? I am using Adobe X Pro.   Thank you!!!

Update: I found this code:
var iPage = 0; // This is your page number, it is 0-based, so page 1 is 0
var sFields = new Array();// array of fields names that are found
for(var x=0;x<numFields;x++)
{var pg = getField(getNthFieldName(x)).page;if((typeof pg == 'number' && pg == iPage) || (typeof pg != 'number' && pg.indexOf(iPage) > -1))sFields[sFields.length] = getNthFieldName(x);}
if(sFields.length > 0)resetForm(sFields);
This code does work, but instead of blanking out the NEW page, it blanks out the original one. Preferably, the original page would retain the information and the new form would be cleared.  I changed var iPage = 0 to var iPage = pageNum +1 and that seems to blank out the spawned page.  Even when I press the button on the spawned page, the second spawned page is cleared.
I know very little about javascript so if anyone sees any problems with this code or the change I made, I'd appreciate if you give me a shout.  Otherwise I guess I resolved this on my own. Thanks!

Similar Messages

  • Clearing fields when calling new page

    I am using a list to call a target page. How can I clear out certain fields when the page is called (ie. reset them to their default value)? If I clear the cache for the page, it clears everything.

    Bob - You first said you wanted to clear out certain values, suggesting that this should take place when a list item link invokes the page and that clearing the cache for the entire page is inadequate because it clears more items than you want cleared. But in that same statement you suggested that you don't want to clear anything out, you want to set specific items to specific values, so I don't see how resetting the entire page is inadequate for the reason you cited. I think it is inadequate becase it clears cache for items when what you want to do is set items to specific values. In your last post, you asked if there is a way to reset all the items to their default value without mentioning the "list item target" situation. So, if the requirement is to set specific items on a page to specific values no matter how the page is invoked, I would recommend using page computations to achieve that. If you want to do this only when the page is invoked by certain URLs, I would suggest passing in an item value that can be checked by the page computations to determine whether or not to set the values.
    Scott

  • Clear field when amount is 0

    Hey,
    I have an input field from the type decimal. When the value, which is coming from the interface,
    is 0, it shows the 0 in the field. Is it possible to supress the output of the field, when it is 0?
    Can you please show me how to do that? I have just done a few changes in Adobe interactive forms,
    so please describe in a way for newbies.
    Thank you!
    Reward points guaranteed

    Hi,
    I have my "page1" and under that a table node.
    Then the table body and then the field called PRICE.
    Like this:
    page1->table->tablebody->PRICE
    And I have done this:
    On the table node at form ready:
    if ($.tablebody.PRICE == 0) then
    $.tablebody.PRICE = ""
    endif
    On the tablebody node at form ready:
    if ($.PRICE == 0) then
    $.PRICE = ""
    endif
    But both didn´t do something...
    Do you know what´s wrong?
    Thank you!

  • Highlight Fields when PDF is opened - LiveCycle 8

    LiveCycle 8
    Win XP
    Hi,
    I'm trying to automatically highlight the form fields on a PDF when it is opened. I want the form to act as though the user has chosen the "Highlight Fields" option/button.
    I would prefer a javascript function to fire (on itialize?) so I don't have to attach code to every field and possibly allow me to easily use it on future PDFs.
    My current thoughts are to loop through all fields on the form and set the fillColor property to a light blue "221,228,255". Here's the javascript I'm currently trying to use:
    for (var i=0; i < xfa.host.numPages; i++){
    ]var oFields = xfa.layout.pageContent(i,"fields");
    ]var nodesLength = oFields.length;
    ]for (var j=0; j< nodesLength; j++){
    ]]var oItem = oFields.item(j);
    ]]oItem.fillColor = "221,228,255";
    Unfortunately, I can't seem to get it to work. Also, I'm not sure where to put it once it does work so that it fires when the PDF is opened.
    Thanks for any help.

    Hi,
    In the File > Form Properties menu opens the dialog window. Go to the Defaults tab and check that the "Save script changes" is set to 'Automatic'. This will make sure that changes to the form from script changes will be saved with the form and honored when the form is reopened.
    Niall
    ...snap...

  • How to avoid clear record when tab pages changes

    Hi All
    I am using oracle forms 10g and db 10g.
    I have created a form with four tab pages. Namely "EXPENSE" , "AMOUNT_DETAILS", "SUPPLIER" , "ACCOUNT".
    When i enter a data in page 1 ie Expense and move to next page page2 "AMOUNT_DETAILS", and enters data in page3 "SUPPLIER" and when i come back to page1 "EXPENSE" and also Page2 "AMOUNT" the data get cleared in Tab pages. There is no data again i need to enter the data manually.
    Can any one suggest me how to avoid this clear data.
    Thanks & Regards
    Srikkanth

    Hi,
    Thanks once again for your quick response.
    I have checked it , i was working with oracle apps.Now i have entered all the datas in the four tab and press save button in the screen at that time also the data get cleared.Can you please tell is there any work around for this.
    regards
    Srikkanth

  • Need blank form fields when page spawned

    Hi all,
    I have a fillable form that has buttons at the top of every page to for the user to duplicate the page in case more information needs to be entered.  Here is the javascript I'm using, courtesy of George Johnson:
    // Get a template object from an existing template
    var t = getTemplate("myTemplate");
    // Spawn the template on the page following this one, and rename the fields
    t.spawn({nPage: pageNum + 1, bRename: true, bOverlay: false});
    This works great, except when the user has already filled out page 1, then clicks the button to duplicate the page, the new page contains the information already filled in by the user on page 1.  Is there a way to clear the fields when the page is duplicated? I am using Adobe X Pro.  Thank you!!!

    Please repost in the Acrobat Scripting forum.

  • Cursor in form field when page opens?

    Client wants cursor in first form text field when page opens,
    without the user clicking in that box. Must be possible, I just
    don't know how to do it.
    Thanks,
    Alan

    all you have to do is set an onload function for the page to
    set the focus of that text field
    <!-- this sets the focus of the text field when the page
    loads -->
    <body OnLoad="document.myform.txtfield.focus();">
    <!-- setting the names up on the form and fields makes the
    javascript work -->
    <form name="myform">
    <input name="txtfield" type="text">
    </form>

  • Set focus to specific field when page is loaded

    Hi
    simple login page (jsp) with 2 fields. when the page is loaded, I want the focus directly in the first field, so that the user can immediately start typing his userid. How do I do this with Creator 2?
    thanks, Peter

    thanks, I was missing the proper search term ... :-)
    here I found the answer: http://swforum.sun.com/jive/thread.jspa?forumID=123&threadID=63057
    Peter

  • How to display clear screenshots in PDF when default Acrobat page resolution is 110 ppi?

    I want screenshots captured on my 96 ppi screen to display clearly in the PDF. But the Acrobat default page resolution display is configured to 110 ppi, not to the system setting of 96 ppi.
    1) Why is the Acrobat default display 110 ppi and not 96 ppi?
    2) If all Adobe Acrobat and Reader users open PDFs with the default Acrobat setting, how should screenshots taken on a 96 ppi screen be resized to display clearly?
    Thanks

    The concept of matching pixels in a bitmap photo to the user's display doesn't exist in PDF. Pages have physical dimensions, not pixel values, so they will always end up being resampled.

  • Tablular Form Items clear when error page is displayed! Please help.

    Hi All,
    I have a page with various form items (2 of which are date pickers) along with a manual tabular form in it.
    When ever I submit the page and it throws any validation error (pl/sql function returning error), all other form fields retain their value, except the fields in the tabular form.
    The values get cleared only when user has clicked on the date picker icon. When user has not clicked on the date pickers, the tabular form retains its value.
    Can anyone please tell me what is going on here? And how do I resolve the issue?
    Thanks & Regards,
    Sumana

    Hi All,
    More information on the issue.
    The issue occurs only in IE. In FireFox, the tabular form elements retain their value.
    I have build the tabular form as a report using sql query. Sample query is:
    SELECT 1 Route_Order
    , apex_item.text(35
    ,25
    ,100
    ,' onBlur="javascript:getLovVal(''f02_'||lpad(1,4,'0')||''',''f35_'||lpad(1,4,'0')||''',''ROUTEE'');" '
    ,'f35_'||lpad(1,4,'0')
    ,NULL
    || '<img src="#IMAGE_PREFIX#htmldb/icons/small_find.gif"> ' Routee_Name
    , NULL Routee_Name_Hidden
    , NULL Project
    , NULL Task
    , NULL Award
    , NULL Percent
    , NULL Notify_Me
    FROM DUAL
    I then edited column attributes of Project, Task etc to text field/select list. It was originally Standard Report Column.
    Thanks,
    Sumana

  • SharePoint Bug? Conflict Error when saving a Page with a "Required" DateTime field in the page layout

    Hello,
    I've just recently encountered a weird error / bug in SharePoint. Here is the scenario:
    - I have a custom column "Test Date" that is of DateTime field type. The field is configured as REQUIRED.
    - It is added to a custom Content Type "Test CT" that is based on a "Publishing Page" content type
    - I have created a Page Layout "Test PL" which is based on that particular content type.
    Now here is what happens:
    1. I try to create a page based on both that Content Type and Page Layout in the Pages Library. I manage to create it successfully.
    2. However, when I go to try and edit the page, fill-in the required values and try to save it using the PAGE TAB -> SAVE BUTTON, I get the below error/s. Note that this happens no matter what I choose in the drop-down menu for Save Button.
    "The file XXX has been modified by USER on DATE"
    But I know I am the ONLY user modifying the page. 
    If I try to save again it gives me options to whether Discard my Changes, Keep Editing, Overwrite Changes, or Merge.
    3. HOWEVER, if I use the Save button on the UPPER RIGHT corner of the screen (the shortcut). I am able to save successfully without any errors!
    The only thing I've tried that made it work was if I made the DateTime OPTIONAL. But I need it to be REQUIRED.
    Is there any workaround to this error / bug?
    Thanks

    I have some additional info but nothing really good. 
    If you click the Save in the left side of the Ribbon then it looks like that is when you get the message. If you click the Save in the top right corner you won't get the message. They must be calling different saving functions. 
    There really is no way around it other than making the field optional which probably removes some server side validation checks causing that message.
    We've chosen to remove that field from the page as I needed it required, then they can't publish the page until they go to the properties and set the article date. By removing the field from the page layout the message goes away.
    I hope MS will fix this at some point.
    -tom daly

  • I have problem when opening a pdf page, my mouse control is hijacked to that tab when im on other tab, i cant scroll or use the middle rollling button, i have to click at the pdf tab then my control over the mouse middle button is restored.

    I think I have this problem even on earlier version. The thing is I set open link in new tab and not switch over to the opened tab. My habit is to open a pdf page in the background and let it load first. What happen is that when the pdf page finished loading ( i do not set to download it), it hijacks my middle mouse button control. When i scroll down or scroll up on my original tab, it wont scroll on the tab, but insttead it scrolls on the pdf tab. I have to click on the pdf tab, then i can use the scrolling function on other tabs back. As for when i opened several pdf tabs, it seems i have to click on the tab that just finished loading, that means several times until they all finish loading. It has been getting on my nerve lately. And all pdf trouble i search from google led to unable to open pdf, firefox hang or crash when opening a pdf and the likes.

    core-el, i don't see the advantage of that or i can't figure out how i'm supposed to use it. for starters, i have to click the mouse in order to get "add bookmark here" to open, which is no different than clicking on the star in the location bar, or right-clicking on the page. there are also options in the bookmarks toolbar, but they all require clicking the mouse & holding down the right button, etc.
    my goal is to use keystrokes only. typing on the keyboard, using both hands, using the space bar & my left pinky finger to tab over are all painless routines for me. as soon as i have to take my fingers off the keyboard & use the mouse, the pain begins.
    as i said, in older versions of firefox, all i had to do to bookmark a page was click ctrl>d, then tab over & arrow down, when appropriate, to find the folder & add the bookmark. for me, as a touch-typist whose speed is between 60 & 80 wpm, this is lightning fast.
    if i have this wrong, please correct me. i just see it as more mouse clicks that don't save me time or pain.

  • I have created a pdf and then want to send it to my boss.  When he recieves it it is saved in the 14 X 8.5 inches version.  How can I saved it on my end as a 11 x 8.5 inch so he doesn't have to uncheck "Choose paper source by PDF page size"?

    I have created a pdf and then want to send it to my boss.  When he recieves it it is saved in the 14 X 8.5 inches version.  How can I saved it on my end as a 11 x 8.5 inch so he doesn't have to uncheck "Choose paper source by PDF page size"?

    Hi heathers,
    You would need to print the file to a new PDF with the appropriate page size.
    Best,
    Sara

  • How do I change default settings in the author field when I edit or insert a comment in a PDF?

    How do I change default settings in the author field when I edit or insert a comment in a PDF?

    Generally it gets this info from the Identity in the preferences. Unfortunately, I know of no way to change the Login Name that shows up in the comments. I need to look at newer versions of Acrobat on other machines, this is AA8.

  • Using javascript in PDF how to identify insatnces of field on all pages

    Hi,
    I am creating a PDF document with report kind strcuture,so that if i have a field in 1 Page (Header section ) then the field will also be there on Page 2 (Header section ) and so on for all pages.
    I am basically creating from a tool.So if i have text field on Page 1 with name 'text1' then on Page 2 it has a name say 'text1_osi21' kind.
    What i need is how to identify or get all the occurences of my desired field on all pages.
    I also tried with getField('text1.0') kind but it wont work since for the second,thrid ... instances of the field its appending a value 'osi#'.
    Also tried using 'rect' properties but we cant gurantee about the position of the desired field to remain same on all pages.
    Please help with any clue
    Thanks & Regards
    nitin

    I can do it with the word  template builderbut not with the layout editor. Is there a way to achieve the same result with the bi layout editor?

Maybe you are looking for