Using Javascript to reset a form on document load

I am trying to reset all field vaules on a acrobat form to the default values, when the form is initially loaded.  I am trying to use the resetForm() method in a document level script, but not having any luck.
I have been able to reset fields after user inputs such as a button that resets the form, or a script the will reset a form prior to importing field data... but I need to ensure all data is removed from the form when the form first loads
Any ideas?

I believe you mean a document level JavaScript, Entering Document Level Scripts, since a Folder level script would require the placing of the code into one of the Acrobat Application's JavaScript folder on the user machine, Entering Folder Level Scripts. Placing the JS code as a Document Level Sept will clear the form when the form is opened. One could also use the Page Open action if additional code is added to prevent re clearing the form if part of a multi page document and one navigates back to the original page.
You should also consider turning off auto complete and auto caching of form data.
Minimizing Exposure of Personal Information on Public Computers

Similar Messages

  • Problem using javascript to submit jsf form, values not submitted

    Greetings!
    I have a t:selectOneMenu where I want the page to be submitted when they change the selected value. At this point, I am able to get the form to submit and reload the page, which is all fine. The problem is that none of the values from the page are not set in the backing bean. I have break points on the setter methods that are not being hit.
    I have tried a number of things from searching multiple forums, but here are snippets from my latest version...
    <h:form>
    <t:commandLink id="hiddenLink" forceId="true" value="test link"
    action="#{pc_PageX.doBtnHiddenLinkAction}"></t:commandLink>
    <t:selectOneMenu id="pageList_top" forceId="true" value="#{pc_PageX.ValueX}"
         onchange="jspellSync(); submitPageX();">
         <f:selectItems value="#{pc_PageX.ListX}" />
    </t:selectOneMenu>
    </h:form>
    function submitPageX(){
         var hiddenLink = document.getElementById("hiddenLink");
         hiddenLink.click();
    }Note that the <t:commandLink> is not hidden, though it will be in the final version if I can get this to work.
    If I click the commandLink myself, the page is submitted with all the page values as expected. If I change the list value, thus using javascript to fire the commandLink's click event, the page is submitted with NO values.
    Can anyone come up with an explanation for this behavior? Or better yet, a solution?
    A couple other things I've tried...
    - Not using a commandLink and using jsf's submit function -> onchange="jspellSync(); submit();"
    - Clicking the link using other ways -> hiddenLink.fireEvent('onclick');
    If all else fails, I'll just add a button that they have to click to submit the form.

    snotmare wrote:
    BalusC wrote:
    I recall this problem in one of the ancient JSF versions. Which JSF version do you use? Do you have any room to upgrade to latest? We're using an IBM implementation of JSF, which is at version 7.0. The IBM implementation appears to be built on the JSF base 1.1.That's not an IBM JSF implementation, they do not have any one, they just have some component libraries which runs on top of some JSF implementation. RAD/WSAD ships by default with Sun JSF RI. Try upgrading to at least 1.1_02 which you can download from the aforementioned link. There's a gap of 2 years (and inherently a lot of bugfixes) compared to 1.1. If the application server used supports Servlet 2.5, you could even upgrade to the latest 1.2.
    We've had other issues with the IBM implementation, which could be the cause in this case too. We've been talking about switching to MyFaces, but there is one feature of the IBM version that we like. It's basically a script collector (hx:scriptCollector) that allows us to do pre-processing on the page.As said before, IBM does not have a JSF implementation. So replacing RI by MyFaces wouldn't make any difference.

  • Problem with using javascript in interactive adobe form

    Hi All,
        I have a problem when accessing text field value which is present inside a subform using javascript.
    I tried giving data.page4.sub-5.<fieldname>.rawvalue but its not working. Please provide a solution.
    Thank you in Advance.

    Since this question is related to JavaScript running within the Form and not the connection between the form and Web Dynpro - it really belongs in the Interactive Forms by Adobe Forum.

  • Using JavaScript to Determine a Form's Folder Name

    We have an awful lot of forms, and in many cases, our custom JavaScript applies to all forms in a given folder. We would like to determine the form's folder name so that we don't have to list each and every form in a giant "IF" statement.
    Has anyone figured out how to determine a form's folder using JavaScript?
    Thanks!
    - Jake

    Jake_Turrell wrote:
    I think the only solution to the "refresh" issue would be to somehow query the hsp_object table and grab the parent_id (which for a form is the folder ID). If anyone figures out how to query the application repository from JavaScript,that would be very, very cool.
    As the database is server side and javascript is client side you would have to use something like an ajax call that passes the form id into an jsp script, the jsp script would query the repository and return the value to javascript.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How to validate People Picket control at client side using javascript/Designer in New form.aspx

    Hi Folks,
    I have list library with 2 columns. where as 1 column is people picker control and it is not mandatory filed .
    When the user open newform.aspx and fill all the column values and submit it should show error message if user not enter any data in people picker control column though it is not a mandatory column.
    How to achieve this by using javascript or sharpoint designer.

    Hello,
    Here is script for that:
    http://social.msdn.microsoft.com/Forums/en-US/f1c2a651-a0fb-484d-af33-e7084439b6c8/validate-sharepoint-people-picker-using-javascript?forum=sharepointgeneralprevious
    http://ankursharepoint.blogspot.in/2012/10/javascript-validation-of-people-picker.html
    Edit your newform.aspx page and add content editor webpart on that page. Then add script on HTML source section.
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Using Javascript to email a form in a workflow process

    I've created an Acroform which will be routed around in a workflow process.  The user will open the form, add information and hit a button which is coded in javascript usng the mailDoc function.
    It works perfectly EXCEPT that each time the document is forwarded, "Adobe Acrobat Pro.pdf" gets appended to the name of the file in the email.  It doesn't actually rename the file, so the file does open properly, but the email looks pretty goofy.
    Example.  The filename is Form14.pdf. 
    When the third person signs off and clicks the email button, the email is created, with the address, subject line and body of the email completed, and the document attached has the little icon and then
    - Form 14.pdf - Adobe Acrobat Pro.pdf - Adobe Acrobat Pro.pdf - Adobe Acrobat Pro.pdf
    Is there some way to prevent it from concatenating like this every time the document is emailed?
    Thanks!!!

    Maybe you could try it like this... I saw this question answered not too long ago.
    Submit Portal Form Values to Portal Report

  • Using javascript to redirect a form in portal to a report

    Hi. I am trying to call a report or a dynamic page from a form I created. When I select the query button I want it to show the report or dynamic page based on the parameters I passed in the URL. I have the following javascript functions that get the parameters from the comboboxes.
    Additional PL/SQL Code... before displaying the page.
    htp.p('<script language="JavaScript">');
    htp.p('function getItemInst(form,targetInst)');
    htp.p('{var objname;');
    htp.p(' var selectedInst;');
    htp.p(' for(var j =0; j < form.length; j++)');
    htp.p(' { objname = form.elements[j].name.split(".");');
    htp.p(' if(objname[2] == targetInst)');
    htp.p(' { selectedInst = form.elements[j].value;');
    htp.p(' return selectedInst;');
    htp.p(' }');
    htp.p(' }');
    htp.p('}');
    htp.p('function getItemCip(form,targetCip)');
    htp.p('{ ');
    htp.p(' var objname;');
    htp.p(' var selectedCip;');
    htp.p(' for(var j =0; j < form.length; j++)');
    htp.p(' {objname = form.elements[j].name.split(".");');
    htp.p(' if(objname[2] == targetCip)');
    htp.p(' { selectedCip = form.elements[j].value;');
    htp.p(' return selectedCip;');
    htp.p(' }');
    htp.p(' }');
    htp.p('}');
    htp.p('</script>');
    When I click the query button it uses this code:
    using a query button->onclick javascript event handler
    var v_inst = getItemInst(this.form, "INST");
    var v_cip_course = getItemCip(this.form, "CIP_COURSE");
    var exec_url = "http://"+window.location.hostname + "/pls/portal/MAJOR_APP.PROGRAMOFSTUDYSEARCHRESULTS.show?p_arg_names=p_cip_course&p_arg_values="+v_cip_course+
    "&p_arg_names=p_inst&p_arg_values="+v_inst;
    window.location.href=exec_url;
    My problem is that it doesn't use the new url I created and go to the report. It just refreshes the form page I created. I am I missing a step or something?
    Thanks ;)

    Maybe you could try it like this... I saw this question answered not too long ago.
    Submit Portal Form Values to Portal Report

  • Using JavaScript to submit a form with multiple submit buttons

    I am a newbie to JavaScript, so hopefully someone can answer
    this for me.
    On my user registration form, I have two buttons that submit
    the form, 'check_availability' (to check if the username is
    available) and 'register'. In my PHP script, I check which button
    was pushed by checking which POST value is set,
    $_POST['check_availability'] or $_POST['register'].
    If I set the 'register' button to a JavaScript function that
    validates the form and then submits it, how do I get my PHP script
    to think 'register' was pushed?

    Sorry I used my old captcha script there.
    [php]
    <?
    session_start();
    if(isset($_POST['button_name'])){
    //DO SOMETHING HERE
    } else {
    //Add the page data
    ?>
    [/php]
    "east99" <[email protected]> wrote in
    message
    news:fepqr8$2mr$[email protected]..
    > Firstly name your buttons then use this script:
    >
    > [php]
    > <?
    > session_start();
    > if(isset($_POST['button_name'])){
    > if ($_POST['vercode'] != $_SESSION['vercode'] OR
    $_SESSION['vercode']=='')
    > {
    > // echo '<strong>Error
    Message</strong><br>';
    > $error = '<strong><font
    color="#FF0000">Error
    > Message</font></strong><br>';
    > } else {
    >
    > //Add the page data
    >
    > }
    > ?>
    > [/php]
    >
    >
    >
    > "AngryCloud" <[email protected]> wrote
    in message
    > news:fecu6r$cl5$[email protected]..
    >>I am a newbie to JavaScript, so hopefully someone can
    answer this for me.
    >>
    >> On my user registration form, I have two buttons
    that submit the form,
    >> 'check_availability' (to check if the username is
    available) and
    >> 'register'. In
    >> my PHP script, I check which button was pushed by
    checking which POST
    >> value is
    >> set, $_POST['check_availability'] or
    $_POST['register'].
    >>
    >> If I set the 'register' button to a JavaScript
    function that validates
    >> the
    >> form and then submits it, how do I get my PHP script
    to think 'register'
    >> was
    >> pushed?
    >>
    >
    >

  • Reset .asp form on page load

    I produced an .asp fillable form in DWCS5 using ASP Form 2 Email extension. Worked very well. Problem -- ONLY with IE. When I "submit" the form, I get the "success" page. If I hit the back button on the browser, all the form info is still there. I inserted the "pragma" meta into the <head> and it resolved the problem in all browsers EXCEPT IE. Any suggestions as to how I can force the cache to clear on page load? Or, maybe a way to disable the "back" button on the browser when the success page has appeared?
    Tom

    DelMar wrote:
    > DW8 / PHP / MySQL
    > How can I submit a form when the user enters the page? I
    want to emulate the
    > user selecting the page and clicking the submit button.
    Can this be done
    > easily?
    Perhaps you're not phrasing your question correctly, but what
    you're
    suggesting is nonsense/not necessary. A form is designed for
    user input.
    If you want the form to be submitted when the page loads, the
    user has
    no opportunity to enter any input before it's submitted. If
    you don't
    want any user input, there is no need to submit a form. You
    simply write
    a PHP script that runs automatically when the page loads.
    Forms play no
    role in your scenario.
    David Powers
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    Author, "Foundation PHP 5 for Flash" (friends of ED)
    http://foundationphp.com/

  • Using Javascript and ScriptUI to create a form that brings in a symbol from library

    Hello everyone,
    I've been trying to pull together the right info to use javascript to create a form to bring in particularsymbols from the symbol library based on the variables taken from the form. I've taken bits and pieces from various sample scripts and tried to make this work, but my problem appears when I try to use conditionals.
    This is a limited version of what I want to do, but it is enough to get the point across.
    1. I want to select a script that has various dropdown boxes. I would like the first dropdown to give me 3 options: 10, 13, 18
    2. I would also like another drop down box that gives me three more options: single needle, double needle, and knife edge.
    3. I would then like it to have an "ok" button and "Cancel" button.
    4. From here when I click the ok button, a symbol is brought in from the library depending on what parameters were given to the form.
    ex. If I selected 10 in the first drop down and double needle in the second, I would like "SYMBOL A" to be pulled from the library and centered on the artboard.
    ex. If I selected 13 in the first drop down and double needle in the second, I would like "SYMBOL B" to be pulled from the library and centered on the artboard.
    I've gotten the UI to pop up and it works as planned as well as bringing in a symbol, my problem comes when I try to incorporate conditionals and functions.
    Here is my script. Please let me know what I'm doing wrong.
    var myDoc = app.activeDocument;
    var Pallette = new Window ("dialog", "Create a Shell");
    Pallette.add ("statictext", undefined, "Fill Opening in Inches:");
    Pallette.orientation = "row";
    var myDropdown =  Pallette.add ("dropdownlist", undefined, ["10", "13", "18"]);
    myDropdown.selection = 1;
    var myButtonGroup =  Pallette.add ("group");
    myButtonGroup.orientation = "column";
    var btnCreate = myButtonGroup.add ("button", undefined, "OK");
    MyFillSelection = myDropdown.selection
    btnCreate.onClick = function () {
        if ( MyFillSelection = "13") {
                   symbolRef = myDoc.symbols["SYMBOL A"];
            symbolItemRef1 = myDoc.symbolItems.add(symbolRef);
           redraw();
    var btnCancel = myButtonGroup.add ("button", undefined, "Cancel");
      Pallette.show ();
    If anyone has any input, it would be much appreciated.
    thanks,

    MyFillSelection = myDropdown.selection is outside the function, so it will always read "13", nothing is making the value change.
    move that line into your function and add the text property to it...MyFillSelection = myDropdown.selection.text;
    then do your if comparisons, that will do it.

  • How reset Acrobat form field using javascript API

    How reset Acrobat form field using javascript API

    There are several ways:
    resetForm(["Text1"]);
    or
    getField("Text1").value = getField("Text1").defaultValue;
    George

  • Reset form using javascript

    Hello,
    I am using jdev 11.1.1.6
    I want to know how to reset the form using javascript.
    For instance...<af:resetActionListener/> does it in jsff
    I need similar implementation

    One solution could be calling a backing bean method from client and reset the form in the backing bean method.
    var customEvent = new AdfCustomEvent(evt.getSource(),"resetFormEvent",null, true);
    customEvent.preventUserInput();
    customEvent.queue(true);

  • Reset the form to Null or Reload the page using reset even after a submit

    Hi ,
    This is the scenario:
    I have two button - Submit and Reset
    Submit is used for validation and after validation is passed it passes it to another form to enter into database.
    Bascially the reset works fine if I use it before using the submit button in the form. For instance,if on submit there is some error as the values have not passed a validation. There is a error pop up message shown and the values are retained in the field and Now if I use reset , all the values of the field do not go back to null.
    I am new with form validation. I checked online and it said that reset will not clear if we have used submit and we need to use javascript to do it.
    So I made reset into a button which onclick event calls the reset() function and clears the form but I am sure that the code is not right as it is not working, I tired putting a alert message in my function to reassue that the function is being called but I think it is not.
    Posting my code
    <INPUT id=reset1 name=reset1 type =button value=Reset onClick="reset()">
    <Script>
    function reset()
    alert ("all values shall be cleared now");
    document.frmUser.name.value = "" ;
    document.frmUser.uservalue  = "" ;
    document.frmUser.contactNumbervalue  = "";
    document.frmUser.emailvalue  = "" ;
    </Script>
    I am not sure if its the best way to do it.
    I want the whole form to refresh/ reload every time reset is clicked and all the fields to have no values.
    Thanks for the help in advance.
    Sumant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Hi .
    I got break on this issue by following the code snippet
    <script >
    function clearForm() {
    document.getElementsByName('foo')[0].value = '';
    document.getElementsByName('bar')[0].value = '';
    document.getElementsByName('baz')[0].value = '';
    </script>
    <html:button value="Clear" onklick="clearForm() />
    thanks,
    Sumant K

  • How can I attach a PDF in an email, using javascript in PDF document?

    How can I attach a PDF in an email, using an interactive button in the PDF-document?
    I tried to create a form button with the menu action 'attach this PDF in an email'.
    This Send.to-action doesn't work with Microsoft.
    Does anyone has a solution by implementing a javascript-code for this in the PDF?

    Dick,
    Thanks for your replie.
    Nice alternative, but it still doesn't work on a Windows machine when the
    mail software from Microsoft doesn't react on PDF actions.
    You can do many things in Acrobat, but it is a problem when it doesn't work
    on Windows and iPad.
    So now I am looking for alternatives like  interactive magazine software
    (based on html5).
    2012/5/11 dick the flash <[email protected]>
       Re: How can I attach a PDF in an email, using javascript in PDF
    document?
    created by dick the flash <http://forums.adobe.com/people/dicktheflash>in
    JavaScript - View the full discussion<http://forums.adobe.com/message/4395927#4395927

  • Using Javascript to calculate monthly payments on form

    I have a single page form where I would like to be able to
    allow the user to choose between making a one time payment or
    monthly payments for a user defined amount. I could easily break
    the form into two pages and calculate the value of the monthly
    payments and display it on the second page if the user selected the
    monthly payment option. What I would like is a single page where
    the monthly payment is determined on the fly when either the user
    selects the monthly payment radio button or when the user defined
    dollar amount is entered.
    I think I have the function determined to do the calculation
    for the monthly payment but I'm unsure as to how to get cf to read
    or display the value. I was trying to use the following with no
    luck:
    <input type=radio name=Installments value="Yes" tabindex=1
    onClick="calculatemonthlypayment(document.forms[0].DonationAmount)">
    <script type="text/javascript">
    function calculatemonthlypayment(donation)
    monthlypayment=(donation/12)
    return monthlypayment
    </script>
    Then trying to output the result like this:
    <cfoutput><input type="text" readonly="yes"
    value="#dollarformat(monthlypayment)#"></cfoutput>
    Any idea what I'm doing wrong or missing? Or is there a much
    better way to accomplish this?

    > <cfoutput><input type="text" readonly="yes"
    value="#dollarformat(monthlypayment)#"></cfoutput>
    You cannot do that. CF code is executed on the server
    (first). The resulting javascript (html, css, ...) code is then
    sent to the browser where it is executed. Since javascript code is
    executed in the client browser,
    after the CF code is already finished, the variable
    "monthlypayment" doesn't exist as far as CF is concerned.
    You can use javascript to both read the donation text field
    amount and calculate the "monthlypayment" amount to display. Here
    is a simple example. You'll need to add validation and number
    formatting.

Maybe you are looking for

  • Data conversion strategy for new SOB

    Dear Viewers on 11.5.10 We are creating a new SOB with a change in currency from Feb-11 as this is the requirement For the same, we need to do data conversion. I have a confusion for Purchase Orders and Sales Orders Purchase Orders: Open purchase ord

  • Loss all of my music, how do i get purchased songs back?

    Was trying to move all my files to an external hard drive, and numberious things happensed after that that I won't get into. I ended up haveing to erase and reinstall my itunes to try to get my music back onto it. Ended up losing it all and wasting a

  • Very slow copy and rm speeds

    I've seen other postings about slow copy processes upon upgrading to Snow Leopard. However, none of the replies seem to address the situations I am experiencing. First, copy times between my MacBook Pro (2 Ghz, 2GB, 100GBHD, 15" - the first MBP intro

  • External's for Editing

    Hey, Just a quick one. What would be the best type of external drive or connection from external to mac be if I wanted to edit with material directly off the external? Firewire would be acceptable for lower file siezes, but what would be the best for

  • Problem using Instant Client 10g with PHP4.3.10-16 on Debian Sarge

    Hello, My current email is [email protected] I am trying to use PHP on Debian box using Oracle 10gR2 on a RH 4 server. Everything works fine individually, but I cannot get PHP4 to use InstantClient to connect to the Oracle Server. This is