Simple Reset Button ( xfa.host.resetData )

I am new to learning javascript and need some help with a reset button.
At the moment is I cannot get the correct syntax to clear just one specific field, never mind a group of them.
Simplified sample of my exisitng (none working) code: xfa.host.resetData ([field1,field2]);
The above doesn't reset just 'Field1' and Field2', it still clears EVERY field.
The end result I need is a button that clears all the fields contained within a subform, but I am unsure of the exact syntax to do this in JavaScript.
Can anyone see where i am going wrong and help?
Many Thanks
Tom Bannister

Tom,
There is a similar post that you can find here
http://www.adobeforums.com/cgi-bin/webx?128@@.3bb8e119

Similar Messages

  • Xfa.host.resetdata doesn't clear imagefield

    I've created a subform containing an imagefield, a textfield and a reset button. The reset button should clear the subform via xfa.host.resetdata but it only clears the textfield but not the imagefield. Anyone else got this problem? Any ideas, workarounds?

    Solved it THX to this solution:
    http://forums.adobe.com/message/1340549?tstart=0#1340549

  • Xfa.host.resetData() error message

    Some users, but not all, are getting an error message "Please select the Client's locale" when they press a button that has a single line of code on its click event: xfa.host.resetData(). The button has the default locale selected in its properties. The form has had the Reader extensions added, but the same thing is happening on the non-extended form.
    The users are using Acrobat Reader 7.0.5. Users with Reader 9 or Acrobat Pro 9 are not having the same issue. I could change the button's locale to English (USA), but that doesn't fix it (I tried) and all the other buttons are set to default locale and work fine.
    This is an 11th hour glitch -- we're supposed to distribute the form tomorrow if at all possible and this is the first time I've seen this.
    Any help greatly appreciated!

    There is a message defined in the mandatory field (State). I am wondering if they have not selected a state and this message is getting displayed (have you tied this field to any others in a calculation)? Just to confirm, change the text of the message and see if it happens again with the new message. It is not happening to me and I am using Acrobat 9 .... also see which version of Acrobat/Reader the troubled users are using.

  • Reset Button Exclusion

    Designer 7.0 provides this JavaScript code automatically when you choose the standard 'reset button' from the Library -- xfa.host.resetData();
    The Calculations & Scripts manual indicates you can add the fields, separated by commas, of all the fields to be reset (included). Is there a way to just list the fields to be excluded instead? I only want to exclude 1 field in a form containing over 50 fields. If I understand the manual correctly, I must enter 49 field names in the parameter so I can exclude just one field. There has got to be a better way (I hope!!).
    Please help!

    As far as I know this is not possible. You either give all the fields you wish to reset or you select all.
    However, you could try something simple like a naming convention to fields (start with a prefix) and then with a little scripting loop through all objects within a container (i.e. subform) and add them to the list of fields to be reset. Instead of you adding them, let the script to the work. Just an Idea

  • Using a reset button for a dynamic table

    I have a 6 page form that includes several dynamic tables. There is a reset button that clears only specific parts of the form because it is something that will be filled out weekly and a lot of the information will stay the same. My problem is that I want the reset button to clear specific rows of the table, but reset whatever is typed in the row for every instance in the table. The reset button only clears the row I want in the first column, not all the other columns/instances. Has anyone done this before or have any suggestions?
    I don't want to include the whole script for the reset button because it has about 100 fields to clear but essentially this is what I have for the dynamic table and it works but only for the first column/instance, the rest stay the same:
    xfa.host.resetData("form1.Page1.Subform1.Table1.Row5.Textbox1.somExpression");

    Hi,
    I’m not sure I understand your exact scenario but I use a function in a script object that I pass in a subform (possibly the top subform to reset the whole form) and the function resets all fields within it. 
    function resetData(node)
        if (node.className === "field")
            var enableResetData = node.desc.nodes.namedItem("enableResetData");
            if (enableResetData === null || enableResetData.value === true)
                // reset all fields except those with enableResetData set to false
                node.rawValue = null;
        else
            for (var i = 0; i < node.nodes.length; i++)
                var currentNode = node.nodes.item(i);
                if (currentNode.isContainer)
                    // ignore some form objects
                    if (currentNode.className !== "draw" &&
                        currentNode.className !== "variables")
                        resetData(currentNode);
    If there are any fields that I don’t want reset I put the following code in the initialise event of those fields.  Depending on the number of fields involved you might what to reverse this logic.  (you could also add the desc.enableResetData element in the XML Source view)
    var enableResetData = this.desc.nodes.namedItem("enableResetData");
    if (enableResetData == null)
        enableResetData = xfa.form.createNode("boolean", "enableResetData");
        this.desc.nodes.append(enableResetData);
    enableResetData.value = true;
    This works by storing a value “enableResetData” in the desc element of the field, allowing a generic function to have specific behaviour for particular fields.
    Hope this helps.
    Bruce

  • Reset button doesn't reset hidden fields

    I've got a form that has hidden fields which hold data that is concatenated into two visible fields (Name1, Name2 and County, State).
    My issue is that when I use the Reset button (the standard one off the library palette with the xfa.host.resetData(""); script in it) it resets all of the fields except for these concatenated fields. I'm guessing that they're not being cleared because the hidden feeder fields aren't being cleared.
    What am I missing to make this work?
    Jennifer

    Hi Frankl and welcome to the Cisco Home Community.
    Have you tried a 30-30-30 reset?
    With the unit powered on, press and hold the reset button on back of unit for 30 seconds
    Without releasing the reset button, unplug the unit and hold reset for another 30 seconds
    Plug the unit back in STILL holding the reset button a final 30 seconds.
    The Search Function is your friend.... and Google too.
    How to Secure your Network
    How to Upgrade Routers Firmware
    Setting-Up a Router with DSL Internet Service
    Setting-Up a Router with Cable Internet Service
    How to Hard Reset or 30/30/30 your Router

  • Acrobat Reader 7.0.3 and xfa.host.exportData("",0);

    I have a lot of forms that I have made with Designer 7.0. Each of them has 'Export XML' button that has the following code
    xfa.host.exportData("",0);
    So far people with Acrobat Reader clients have been able to export form content to XML file, but now it seems that after some update (7.0.3) this is no longer possible?
    Is this really so?
    Br,
    Kari

    Hi!
    No, it is no so.
    At least it works fine with my forms. I have trouble with the
    xfa.host.importData();
    which gives me an error message even though it works.
    Håkon

  • How to change appearance of xfa.host.messagebox

        Is there anyway to apply a different look to the xfa.host.messagebox ?  It is pretty, um what is the word ..... -- ugly. That is the word
    Any help would be very appreciated.
    Thanks

    Hi,
    The url that Steve gave above takes you to the Help file for LC Designer.
    You put the messageBox line within your script when you want to alert the user to something or to give them a choice. for example you could put the script within a calculate event to let the user know the value of a hidden variable:
    xfa.host.messageBox("This is a message", "This is a title", 3, 1);
    The help file sets out the four different options for the last two parameters (which can be used in any combination).
    xfa.host.messageBox("This messageBox uses:\n\nParameter 3 = 1 (Warning) and Parameter 4 = 1 (OK, Cancel)", "Hello World!", 1, 1);
    The "\n" will insert a return (new line).
    Scripting for additional features within a dialogue window can be achieved using the Javascript Dialog Object; however this is getting quite advanced. The AcroDialog product from Windjack Solutions does make this process easier.
    The messageBox returns a number depending on which button the user clicks:
    Returns 1 if the user clicks OK;
    Returns 2 if the user clicks Cancel;
    Returns 3 if the user clicks No;
    Returns 4 if the user clicks Yes;
    On this basis you can script actions depending on which button the user clicks in your messageBox, by asigning the returning value to a variable and then looking at the value of the variable. For example in the click event of a button on the form:
    var nButton = xfa.host.messageBox("You are about to delete this row.\n\nDo you want to continue?", "DELETE ROW", 3, 2);
    if (nButton == 4) // Hitting the Yes button returns 4
         _dyndetail.removeInstance(this.parent.index); // proceed with delete
    The above deals with LiveCycle Designer. If you are scripting exclusively in Acrobat then you could use the app.alert(); method, to display your message.
    Hope this helps,
    Niall

  • Xfa.host.gotoURL() in Adobe Reader / Dynamic Tables with AcroForms?

    Hi All,
    I have a dynamic table in my LifeCycle form. Each table row contains a button that links to an external PDF file (using xfa.host.gotoURL). The links work fine in Acrobat 8 Pro, so far, so good... But when clicking the buttons in Reader 8, nothing happens. No error message or security warning, nothing...
    I searched the web and some forums for this problem and by reading between the lines of some posts I came to guess that my LifeCycle form will not work in Adobe Reader unless I purchase the respective LifeCycle Extensions license... :-/
    What exactly are my options now? Can I get the buttons to work in Adobe Reader somehow (using JS) without having to purchase the Reader Extensions? Or can I somehow recreate the dynamic table of the LifeCycle form using AcroForms in Acrobat 8 Pro to avoid the problem? If so, how do I add such a table using Acrobat's form tools...?
    Thanks for your help,
    Marcus

    Normal http://... URLs do indeed work, but relative URLs pointing to local files do not work with the Adobe Reader on my machine. I thought this might be due to a security restriction that can only be overcome by using the Reader Extensions...?
    Is there any other way of linking to other PDFs on the local machine than the gotoURL method? I also tried launchApp(), but it didn't work either.
    I currently use this statement to link to PDFs in a subfolder:
    xfa.host.gotoURL("TrainingGuides/"
    + docName + ".pdf", 1);

  • Xfa.host.SetFocus question.

    I have a code on Exit event of the field that checks if 5 digit US ZIP code, 5 digit US ZIP code + 4, and 6 digit alphanumeric Canadian Postal Code.
    If user enters valid 5 digits code, then I set focus to specific field-FField1. Code is simple and it works. What does not work is, if I tab out , without entering anyting in the Zip code, the focus is set to some other field, not FField1. How can I force it with the code that focus is set to FField1 all the time.
    Code is simple:
    var regExpDate = /^\^\d{5}-\d{4}|\d{5}|[A-Z]\d[A-Z] \d[A-Z]\d$ $/;
    var vMatched = this.rawValue.match(regExpDate);
    if (!vMatched){
    this.rawValue=null;
    xfa.host.messageBox("Enter the following format: 99999 or 99999-9999 or A9A 9A9 );
    xfa.host.setFocus(this);
    else
    xfa.host.setFocus(form1.subform1.FField1);

    Hi again 1996,
    You can use setFocus multiple times in the exit event, and the last one that is called is where you end up. I would suggest putting the 'default' tab before all of your logic, to ensure that it's the one that gets called when the field is valid:
    i.e.:
    xfa.host.setFocus(form1.subform1.FField1);
    var regExpDate = /^\^\d{5}-\d{4}|\d{5}|[A-Z]\d[A-Z] \d[A-Z]\d$ $/;
    var vMatched = this.rawValue.match(regExpDate);
    if (!vMatched){
    this.rawValue=null;
    xfa.host.messageBox("Enter the following format: 99999 or 99999-9999 or A9A 9A9 );
    xfa.host.setFocus(this);
    This way, unless vMatched is true and the second setFocus is called to override the first, your user should always be sent to FField1.
    I know that this isn't a part of your question, but I'd like to suggest avoiding the 'thou shalt not pass until...' situations. What if your user doesn't know the postal/zip code, and wants to fill in the rest of the form before finding it? They could enter dummy data to get past your requirement, but then there's a chance that they'll forget to replace it with the real value. Altogether, I think it's better to check for invalid data in the pre-save/pre-submit events, and warn them of the required fields then.
    Also, consider only calling setFocus for when the user is tabbing away from fields. If you manually call setFocus to control the tab order from all fields (I do this for all of my forms, as I find that dynamic forms don't play nice with the tab order) then use:
    if (xfa.event.commitKey == 3) then
         xfa.host.setFocus("$.parent.NextFieldName");
    endif
    This way, if the user clicks on another field that they want to fill next, they won't be redirected to the one you chose for them.
    Sorry for the unsolicited advice... These were just some of the things that I've had to deal with in the past.
    - Scott

  • How to hide reset button in af-query panel in ADF

    Hello All,
    i am using Jdeveloper version- 11.1.2.0.38.60.17 ,i am facing problem with hiding reset button in "af-Query panel".
    kindly suggest me how to hide it. it's urgent.
    Thanks & Regards
    AbhijeetPS
    Edited by: 967068 on Oct 23, 2012 12:39 PM

    Hello All
    I have solved this problem.
    Go to Query panel properties inspector and set Display mode = simple
    and drag an af- command button outside of the query panel.
    <af:commandButton text="Search" id="cb6" actionListener="#{bindings.Execute.execute}"/>
    Thanks
    AbhijeetPS
    Edited by: AbhijeetPS on Oct 23, 2012 6:38 PM

  • Xfa.host.exportData and Reader

    I've created a dynamic xml PDF form in Adobe LiveCycle designer.
    Inside the form I placed a button and on the click event I call xfa.host.exportData("",0);
    Then opened the file in Acrobat Professional, clicked the button and it works Yay! Then I Saved Other as Reader Extended PDF.
    Opened the newly saved file in Reader XI and when I click the button the JavaScript console spit out the following error:
    NotAllowedError: Security settings prevent access to this property or method.
    Doc.exportXFAData:-1:XFA:form1[0]:page3[0]:Button1[0]:click
    This is really annoying and could use some guidance.

    Take a look at the documentation for Doc.exportXFAData():
    http://help.adobe.com/livedocs/acrobat_sdk/11/Acrobat11_HTMLHelp/wwhelp/wwhimpl/common/htm l/wwhelp.htm?context=Acrobat11_HTMLHelp&file=JS_API_AcroJS.89.470.html
    As you can see from the "F" in the Quickbar, the document would need "Forms
    Rights" for this to work in Reader (
    http://help.adobe.com/livedocs/acrobat_sdk/11/Acrobat11_HTMLHelp/wwhelp/wwhimpl/common/htm l/wwhelp.htm?context=Acrobat11_HTMLHelp&file=JS_API_AcroJSPreface.88.8.html).
    You need LiveCycle Reader Extensions to assign those rights.
    Unless you can assign form rights to your document, this will not work in
    Reader.

  • Xfa.host.importData()

    Hi,
    I have stand-alone form PDF file, reader-extended, I open it with Reader-X,
    and I have a piece of javascript behind a button on the form that calls the importData() method,
    to import a XML data file.
    say, my form has 6 fields: a, b, c, x, y, z
    and the XML file has data in a, b, c, d, e, f
    it appears that after the importData() call, my form fields a, b, c got populated with data from the XML file,
    but the fields x, y, z got wiped out at the same time.  they become "null".
    Is it supposed to work like that?
    or maybe I have done something wrong?
    If it's supposed to work that way, is there a way to keep the data in x, y, z after the importData() call?
    is there another method that I can use to keep the original data in x, y, z?
    thanks

    Hi,
    If you open the form in LC Designer and select x, y, and z fields. Go to the Object > Binding palette and select the binding as None. This means that the fields will not take part in an XML data import OR export. This might suit your requirements, depending on how you are processing returning data.
    If you need to export data in the x, y, and z fields, then change the binding back to Normal/Name.
    As a workaround, you could script variables to have the values of the x, y and z fields BEFORE the import script. Then repopulate the fields after import. Something like this:
    // declare the variables
    var myX = TextField1.rawValue;
    var myY = TextField2.rawValue;
    var myZ = TextField3.rawValue;
    // import the xml
    xfa.host.importData();
    // repopulate fields
    TextField1.rawValue = myX;
    TextField2.rawValue = myY;
    TextField3.rawValue = myZ;
    Hope that helps,
    Niall
    Assure Dynamics

  • Send and reset buttons won't work on contact form

    Hey, I'm using Flash CS3 and ActionScript 2. I've created a simple contact page, inside a movie clip (because I got it fading in and out), I've put the script on the main timeline, so not inside the movie, but the send and reset buttons won't respond all. I've checked the instance names and spellings are correct, here's the script I'm using:
    contact_tween.send_button.onPress = function() {
             if (name eq "" or subject eq "" or message eq "" or email eq "") {
                   stop();
             } else {
             loadVariablesNum("form.php", 0, "POST");
             gotoAndPlay(211);
    contact_tween.reset_button.onPress = function() {
         name="";
         subject="";
         message="";
         email="";
    so, what am I doing wrong? any help appreciated, thanks.
    ps. contact_tween is the name of movie I created to fade the whole contact page in and out.

    ok, i've got the send button working, it was the script on the keyframe that controls the contact form, i copied the code from an older version of the contact file where the send button works. i've checked all the frames, and made sure there aren't any unnecessary instance names, duplicate or otherwise. only thing is the reset button still doesn't work.
    another thing i'm not sure of, do i need to upload the swf and php files to a server, or should i be able to get a test email in my inbox if i test it from my computer without uploading?

  • Xfa.host.beep

    I have a button that I want to make a Windows error sound when certain conditions are met. I've tried variations of xfa.host.beep() (e.g. xfa.host.beep("1"), xfa.host.beep("2")), but they never generate any sound. I tried both Acrobat and Reader (11.0.09) static and dynamic forms.

    Well actually, they didn't. I looked at my sound mixer (Windows 7)
    System sounds were disabled...

Maybe you are looking for

  • Fail to add Mailbox server to DAG

    I'm Setting up Exchange Server 2013 Mailing system, the schema that i'm deploying includes two CAS servers : 3S-CAS1 and 3S-CAS2 for load balancing access authentication; and two mailbox servers 3S-MBX1 and 3S-MBX2. A File share server 3S-FW is used

  • How to tranfert music from an ipod to my computer?

    I want to transfert songs from my friend's ipod to my computer's itune. He is jut visiting me so it's a little be urgent. I'll be glad if somebody could help me Thanks for your consideration

  • Float Data Value and Scientific Notation

    Hello All, SQL Server converts some of the float value into scientific notation for example 0.00001 will be stored as 1E-05. Is there any simple method\formula\threshold to precisely tell when some particular value will be converted to scientific not

  • Besides all skepticism from some pple here the release of iPhone in Vzla

    Like I assured you in my last posts in here, the Apple LA website now has the flag included in the countries that will sell the iPhone 3G very soon!! http://www.apple.com/la/iphone/ http://www.apple.com/la/iphone/buy/#ve P.S. This is a note for Tamar

  • Firefox 7 beta is not printing all pages

    All is in question. I have found a page http://www.modssl.org/docs/2.8/ssl_reference.html which is around 20 pages. When I print it in firefox it prints only first 10 pages. in IE works fine. Firefox displays only 10 pages in the print preview as wel