How to auto populate a field based on drop down list unless specific item is selected

Hi all,
Apologies if I have posted this in the wrong area but I am new to Adobe LiveCycle, JavaScript and these forums.
I am trying to build an Acrobat form using LiveCycle but am having trouble with the drop down lists.
Inititaly I simply wanted to populate fields in one table based on the selection of a corresponding drop down list in another table.
I used the following code and it worked fine:
Workbook.Content.Table1.Row3.AppropriationDetails.Row4.Cell1::change - (JavaScript, client)
var fFrom = xfa.resolveNodes("Workbook.Content.Table1.Row3.AppropriationDetails[*].Row4.Cell1");
var fTo = xfa.resolveNodes("Workbook.Content.Table2.Row3.AppropriationDetails[*].Row4.Cell1");
for (var i=0; i <= fFrom.length-1; i++) {
     fTo.item(i).rawValue = fFrom.item(i).boundItem(xfa.event.newText);
The problem is that now I want the above code to work UNLESS one of the items in the dropdown list is specifically selected in which case I want the text box in the other table to display a message such as "Enter details in the field below".
I have tried to create an If Else statement using the following code:
Workbook.Content.Table1.Row3.AppropriationDetails.Row4.Cell1::change - (JavaScript, client)
var fFrom = xfa.resolveNodes("Workbook.Content.Table1.Row3.AppropriationDetails[*].Row4.Cell1");
var fTo = xfa.resolveNodes("Workbook.Content.Table2.Row3.AppropriationDetails[*].Row4.Cell1"); 
for (var i=0; i <= fFrom.length-1; i++) {
     if (fFrom.item(i).rawvalue = "Option 3"){
     fTo.item(i).rawValue = "Enter details in the field below";
     else {
     fTo.item(i).rawValue = fFrom.item(i).boundItem(xfa.event.newText);
The code now populates the field with "Enter the details in the field below" no matter what item I select from the dropdown list.
Your help is greatly appreciated.
Cheers,
ozzy_q

Follow Up:
Ok so ive changed things up a bit and have had some more success.
I have used a Switch statement in my For loop to perform different actions based on the item selected.
The code looks like this:
Workbook.Content.Table1.Row3.AppropriationDetails.Row4.Cell1::change - (JavaScript, client)
var fFrom = xfa.resolveNodes("Workbook.Content.Table1.Row3.AppropriationDetails[*] .Row4.Cell1");
var fTo = xfa.resolveNodes("Workbook.Content.Table2.Row3.AppropriationDetails[* ].Row4.Cell1");
for (var i=0; i <= fFrom.length-1; i++) {
     switch (fFrom.item(i).rawValue)
     case "Option 3":
     fTo.item(i).rawValue = "Enter the details in the field below";
     break;
     default:
     fTo.item(i).rawValue = fFrom.item(i).boundItem(xfa.event.newText);
     break;
This code solves my problem but has thrown up a new issue:
When i select Option 1 or 2 from the dropdown list  the change in the text field is instantaneous, however if I select Option 3 it wont appear in the text field until I either select Option 3 a second time or select another item. Its as if the text field is a selction behind what I have enterd in the dropdown list.
Any thoughts?

Similar Messages

  • Using JavaScript to auto populate a field based on numeric value of a separate drop down field

    Hello, I am trying to set up a simple, I hope, javascript which will enable to me auto populate one field based on the numberic value of another field using Acrobat Pro XI.
    Essentially I have 2 drop down fields (we'll call them DD1 and DD2).
    DD1 is the sum of 8 preceding drop down values. That sum can be anywhere from 0 - 40. Whatever that sum falls within a range which identifies a rating. The ratings and ranges are below:
    0-8: Non-Performer  
    9-16: Low Performer  
    17-24: Performer  
    25-32: High Performer  
    33-40: Exceptional Performer
    DD2 is where the rating ("non-performer", "low performer", etc.) will be captured. Instead of requiring the user to look at DD1, determine the value, and then identify and input the rating manually, I would like DD2 to auto populate the rating based on the value (sum) in DD1.
    For example, if DD1 shows a value of 27 then DD2 would auto populate "High Performer". So how do I write this code or execute this? In excel I would use an if, then statement. Is there something similar in Acrobat Pro XI.
    Any help is greatly appreciated. Thank you in advance.

    If you use a text field, the custom calculation script could be:
    // Custom calculation script for text field
    (function () {
        var s = getField("DD1").valueAsString;
        // Blank this field if input is blank
        if (!s) {
            event.value = "";
            return;
        // Convert string to number
        var v = +s;
        // Set this field's value based on the input
        if (v <= 40 && v >= 33) {
            event.value = "Exceptional Performer";
            return;
        if (v < 33 && v >= 25) {
            event.value = "High Performer";
            return;
        if (v < 25 && v >= 17) {
            event.value = "Performer";
            return;
        if (v < 17 && v >= 9) {
            event.value = "Low Performer";
            return;
        if (v < 9 && v >= 0) {
            event.value = "Non-Performer";
            return;
        // If none of the above fit, blank this field
        event.value = "";

  • I have Maveriks. I downloaded numerous ACID Fonts and purchased Stuffit as instructed by ACID Fonts in order to use them. However, now I am unable to figure out how to get them into my Font Family drop down list or insert into Pages. PLS HELP!

    I have Maveriks. I downloaded numerous ACID Fonts and purchased Stuffit as instructed by ACID Fonts in order to use them. However, now I am unable to figure out how to get them into my Font Family drop down list or insert into Pages. PLS HELP!

    Hi FancyJean!
    Here is an article for you about using Font Book and installing fonts that you have downloaded:
    Mac Basics: Font Book
    http://support.apple.com/kb/ht2509
    Thanks for being a part of the Apple Support Communities!
    Cheers,
    Braden

  • Auto-populate form fields based on end user input?

    I'm currently attempting to create a new form that has a combo box "Locations" with various options.  What I'm looking to do is have another text field auto populate other fields related to that location (such as address, contact information) to save on time and reduce opportunity for end user errors in input.
    What are my options for accomplishing such a task?  Some form of binding fields with a MS database possibly?
    Thanks in advance for any advice and assistance on this matter!

    Paul,
    The form and (potential) database would be located on a shared drive on the company network in which those that would use the form already have access to.
    The pc's that user's would be using have Reader 9.
    The pc I'm using for developing this form has LC Designer 8, Acrobat Professional 8, and Reader 9.
    Ideally, I would "like" for the end user to have the ability to add new locations, addresses, etc ... in the event it is needed, although this would not be likely to come up.
    Based on the software I have on hand, and the need to not incur additional expenses, what would you suggest?
    Thanks again Paul!

  • How do i populate one field based upon a drop down select from another field?

    Here is what I am trying to do:
    Field 1 is a drop down selection list that requires a user to make a mandatory selection which in this case is a list of apartment complexes. What I am trying to accomplish is once that user makes a selection from the drop down list (Field1) that it will populate Field 2 (standard txt) with the corresponding apartment complexes address.
    So I pick Talan Apartments from field 1, it would populate field 2 with Talan Apartments address. I tried messing around with calculation scripts but I'm fighting a loosing battle here. Some help would be greatly appreciated!

    Hi,
    Here is a sample: https://acrobat.com/#d=Hi0ZwVgVB1PWbxc6OJ0z4A where the script in the exit event of the dropdown sets the value of the address object.
    Good luck,
    Niall

  • Populate a drop down list with data from Excel and fill in a text field, based on drop down selectio

    Hi!
    I have a problem with a PDF form: There's a drop down list that I populate with Excel data that I've put in an XML file through an XSD file -- no problem here. The drop down list has a data binding to the XML file, so that a choice in the drop down list can be associated with an object in the XML file. So, when I make a choice in the drop down list, a corresponding object value is fetched from the XML file and put in a text field on the form.
    How to do this is described by Stefan Cameron here:
    http://forms.stefcameron.com/2006/07/29/dynamic-properties/
    There's a snag, though, and to describe it more clearly:
    The XML file contains three types of objects: role, role number, and role cost center. Of these I use the first and the third, i.e. the role and the role cost center. The drop down list contains the roles, and when I select a role, the corresponding cost center is filled out in the text field. So far, so good!
    But -- if the cost center has the same value for two or more roles, all of these roles "bounce back" into the drop down list, that is, they are all selected in the drop down list. How many of these you can see depend on the height of the drop down list -- if it's low you'll only see the first one.
    If I modify Stefan Cameron's data in his example I get the same behavior, so the problem seems to have to do with how XML data are fetched.
    I'm sure there's a workaround, but I can't find it! I've spent many hours browsing the web without finding anyone with a similar problem.
    Any suggestions appreciated!

    Although your issue is far beyond mine, I was hoping you can help me out.....
    I need to create a drop down list of names which I wish to somehow link to an Excel spreadsheet.
    Please let me know the steps I need to do.  I've tried several things, but nothing seems to work and I'm not sure what I am doing wrong.
    Thank you

  • How to set a default value for a drop down list box and then apply cascading based on the default value in Infopath 2010.

    Hello Everyone
    I have two drop downs. Both are coming from look up fields from two lists. i want to set a default value(first list item) for the first drop down list box and then apply cascading based on the default value for the next drop down list box. I found one article(http://www.bizsupportonline.net/infopath2010/display-first-item-drop-down-list-box-infopath-2010.htm)
    where in i can set a default value but i can't apply cascading based on that default value. Any suggestions would be highly appreciated.
    Thanks
    Ramanjulu Naidu N

    Hey Ramanjulu,
    Take a look at the below article which I believe will answer your question.
    http://basquang.wordpress.com/2010/03/29/cascading-drop-down-list-in-sharepoint-2010-using-infopath-2010/
    Daniel Christian (MCTS)

  • How to populate the values in the drop down list form the xml file ?

    I want to populate the drop down list values from a seperate xml file called ReferenceData. I created this file, which consists of a mapping entry in the form of ( key,value ) pair. Am mapping this xml file in to form by using rule named as getAppReferenceData.
    But the values are not getting populated in the form. And I have a doubt of, where should we keep that xml file? (under which path / folder ).

    what would help is if you showed what you do in the rule, either the code or a express trace of the rule.
    The other thing you need to know is where you want to get the file from. Yes java can read a file from anywhere on the system but there is a security layer in there which might prevent the file being opened. Have you allowed acces to the file via the security policy settings via java.io.FilePermission?
    WilfredS

  • How to display Current Year and Month in Drop Down list

    Hi Dear friends,
    I am devloping a report. It has got 2 pages--input and output(Report) page.
    IN input page, user will select Month and Year from drop down list as one of the input parameters. (seperate drop down list 4 month and year)
    Now, my problem is:
    HOw to display current month and year by default in the dropdown list...........
    I hope my question is clear.
    Please help.
    Regards,
    ASh

    NO da,
    it is not working.
    First i tired with for-loop. I initialized variable "i" to -2 (i=-2) I would get the year drop down list from 2003 but, by default 2003 would come.
    So, i posted the question.
    I tried your code. It is giving following error.
    A Servlet Exception Has Occurred
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occured between lines: 122 and 127 in the jsp file: /test/inpt.jsp
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:182: Invalid type expression.
    first.set(Calendar.YEAR, 2003)
    ^
    An error occured between lines: 127 and 131 in the jsp file: /test/inpt.jsp
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:186: Invalid declaration.
    out.write("\r\n \r\nYear : \r\n \r\n"); ^ An error occured between lines: 198 and 203 in the jsp file: /test/inpt.jsp Generated servlet error: C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:282: Invalid type expression. first1.set(Calendar.YEAR, 2003) ^ An error occured between lines: 203 and 207 in the jsp file: /test/inpt.jsp Generated servlet error: C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:286: Invalid declaration. out.write("\r\n \r\nYear :\r\n \r\n");
    ^
    4 errors
    Pls. Help.
    Regards,
    Ashu

  • How to add Check box to a static Drop down list (bases on a selection list) and allow mulity select in it?

    Dear All,
    I created a text field in my project (Light switch 201, C#), this text field has a static list which I filled manually. when I click in this text box I get a dropp down list which allow me to chose only one value from it.
    Now what I want to do is to add a check box in this drop down list and allow mulity selection from this list. My list looks as follow:
    Can anyone help me :) ? 
    Thanks all,
    Zayed

    Something like this:
    http://www.codeproject.com/Tips/452756/Add-checkbox-inside-combobox-in-Silverlight

  • Using a iPad.  How do you delete unwanted address from the drop down list.  I typed in a wrong address once, and now it keeps showing up.

    Using a iPad.  How do you delete unwanted address from the mail drop down list.  I typed in a wrong address once, and now it keeps showing up.

    Winfax1-
    Look in your Contacts App and see if the unwanted address is entered there.  If it is, you can delete it there.
    Fred

  • How do I modify the contents of the drop down list of sites in the navigation toolbar?

    The navigation toolbar has a drop down icon, and when I click on it, I get a list of 10 or so web sites. These appear to be the first 10 sites that I visited since my history was last cleared. I would like these instead to be sites that I often visit, and would like to update the list periodically. I cannot find any way to modify this list of sites.

    Remove those sites from the history. That drop down list is based on bonus points that are added if you visit a link.
    * https://support.mozilla.com/kb/Clearing+Location+bar+history
    * https://support.mozilla.com/kb/Cannot+clear+Location+bar+history

  • How can I change the order in the drop down list of the teamviewer

    HI all
    If I can change the order in the drop down list of the teamviewer?
    example the default is "Direct Reports",I want to change it to the "Employees in Organizational Structure".
    Best Regards

    Cui,
    It is based on OADP. goto SPRo - Integration with other mySAP.com components - business packages/functional packages- manager self services()-Object and data provider-
    Thanks
    Bala Duvvuri

  • How to create a form that can auto-populate all fields based on a specific selection?

    We have created a template for each type of package used in our business.  The template is the same but depending on the package selected, the fields would be populated differently.  How can we create a template to load the fields based on the specific package selected?  We use Adobe Acrobat Pro in creating the templates.

    This forum is for the Adobe FormsCentral (http://formscentral.adobe.com) which is a service that allows you to create, collect and analyze data using an online web form. You should ask Acrobat/PDF related form questions in the Acrobat forums:http://forums.adobe.com/community/acrobat/acrobat_windows
    I'll move your post to that forum so you don't need to retype it. They can help you out...
    Randy

  • How to auto-populate form fields between documents?

    I'd like to create an interactive form where the user inputs data into different fields and then the data gets auto-populated into other fields in forms linked to the original form. Is this possible with Acrobat XI? If not, then which Adobe product is best suited for this? If it's possible, how difficult is this to do? I don't need exact "how to" tips at this point. I am not a developer and I don't have any experience with Action Script. I'm just researching what products I can use, as a non-techie, to do the job. Thanks.

    Thanks for your reply. I'm having a hard time understanding the functionality on the end-users's side with the different Adobe forms products. I did a little more reading up on this, but it's still not 100% clear. Perhaps you can help clarify.
    Scenario 1: The user does NOT have a copy of Acrobat XI on their end, and  I do NOT have a subscriptiont to FormsCentral, and I do NOT enable import/export features in the form using Adobe LiveCycle Reader Extensions. In this scenario, the user can fill out my form, but they can't save a copy of the completed form on their local drive. I, however, get a copy of the completed form where I can then extract and analyze the data.
    Scenario 2: The user does NOT have a copy of Acrobat XI on their end, but I have have a subscriptiont to FormsCentral. The user can complete the form and save it on their local drive, but I can't have data auto-populate from one to another. (Note: I went to the FormsCentral website and it says "Allow respondents to download the PDF form, print out, save, EDIT and submit later." I interperet that as meaning they can add text to a fillable form and save it on their end.)
    Scenario 3: The user does NOT have a copy of Acrobat XI on their end, but I have enabled the form with LiveCycle Reader Extensions so that I can have data auto-populate from one form to another. However, I have to pay for an Extension license fee. I managed to find the pricing, and it's too expensive for my needs right now. I'm looking to share the forms with students, so this is not an option.
    Scenario 4: The use HAS Acrobat XI. I can get data to auto-populate from one form to another and the user can complete and save on their local drive. This scenarios is not an option for me / Can't get students or schools to pay for a full license of Acrobat XI is not an option at this point.
    Is my understanding correct? If so, I feel like I've hit a dead-end. The only cost-effective solution is to have a simple fillable form without the ability to auto-populate data between forms. Sigh.
    Thanks.

Maybe you are looking for

  • Error while Deleting Customer Master

    Dear Friends, I have a Customer master record, in which not even a single transaction (SD or FI) has been posted till date. We now want to delete this Customer Master record & I am trying through T-Code OBR2 But I am getting a Error - Reset the numbe

  • RPC Style Web Service and SSL

    Hi, Has anyone tried (and maybe succeeded) in accessing an RPC-style Web Service deployed on WebLogic Server 6.1 using SSL? I have a Web Service deployed and am able to access it using JNDI and the weblogic.soap.http.SoapInitialContextFactory INITIAL

  • How can transfer Mac Outlook Contact files to the MacPro Address book?

    I tried the suggested three step process, ie, (1) Export Contacts from Outlook in txt formant, and (2) Open the txt file Excel and Save As in csv format, (3) Import the csv file into the MacPro Address book. However the Export from Outlook Contacts i

  • New feature to ios 4?

    I just realized that when I am listening to music and my screen is asleep, every time the song changes, the screen turns on for about 5 seconds to show the new song. Anyone else see this? Is this something new to ios 4? I don't remember this on my 3g

  • Regarding bonus buy information in table KONBBYH

    Hi, I have input REF_PROMO from table WAKH.   Using which I need to find whether it is Submission Bonus Buy. To find the Submission Bonus Buy Id the table KONBBYH is read.  But how to link WAKH-REF_PROMO and KONBBYH table?  Or how will I decide that