How the auto fill a field based on the drop-down list unless the specific item is selected

Hi all

My apologies if I posted this in in the wrong place, but I am new to these forums, JavaScript and Adobe LiveCycle.

I am trying to build a form using LiveCycle Acrobat but have problems with the drop-down lists.

Inititaly I just wanted to fill in the fields in a table based on a matching menu selection dropdown in another table.

I used the following code and it worked fine:

Workbook.Content.Table1.Row3.AppropriationDetails.Row4.Cell1::change - (JavaScript, client)

fFrom var = xfa.resolveNodes ("Workbook.Content.Table1.Row3.AppropriationDetails [*]. Row4.cell1');

OTF var = 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 code above works UNLESS one of the items in the drop-down list is enabled specifically in this case, I want the text box in the other table to display a message such as "Details of the entry in the field below.

I tried to create an If Else statement using the following code:

Workbook.Content.Table1.Row3.AppropriationDetails.Row4.Cell1::change - (JavaScript, client)

fFrom var = xfa.resolveNodes ("Workbook.Content.Table1.Row3.AppropriationDetails [*]. Row4.cell1');

OTF var = 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 the details in the field below.

}

else {}

fTo.item (i) .rawValue = fFrom.item (i) .boundItem (xfa.event.newText);

}

}

The code now filled the field with "Enter the details in the field below" any item I select in the drop-down list.

Your help is greatly appreciated.

See you soon,.

ozzy_q

Hello

You use .rawValue in the change event. This will cause problems because the selection of the users has not received .rawValue from the drop-down list at the time when the change event is triggered.

Move your script as it should to the output of the dropdown event.

Hope that helps,

Niall

Tags: Adobe LiveCycle

Similar Questions

  • Fill other fields based on a drop-down list box

    Hello

    I am completely new to LiveCycle and just starting to teach me how to use it.

    I want to speed up the filling of a purchase order by bringing them to fill based essentially on what is put in other areas.

    For example, I would like to than our usual suppliers to be included in a drop of water to the bottom of the box (I know not how, at least) and then have the address fields automatically filled.

    I know that I can do this using javascript, but it is rather annoying because I don't want to sit here put 276 suppliers in my script. In addition, I don't want to have to edit the script whenever we want to add a new provider.

    Is it possible to create a form that made it and can pull info on another file or database? Also, I would make it pretty fool-proof when it comes to adding new suppliers.

    Thank you

    Darryl

    The way to proceed is to hang on to the top of the drop-down list for a service web and that the web service returns a list of providers (in load of the form). Once the user selects a supplier a second web service would draw information and fill in the appropriate fields.  This technique is easier to configure on the client machines (as all the information is contained in the form). You will need to get another piece of software called LiveCycle Reader Extensions Server to allow the form make calls from web service of the player (assuming that the reader is used).

    The form can connect to a database directly, but this solution has drawbacks as well. You need to configure a dataconnection on each machine as the machine must be on the same network as the DB. It will work on Windows machines. You also punctuated by player to allow DB with Reader connections.

    Hope that helps

    Paul

  • How to fill a textfield based on a drop-down list and a checkbox control

    Hi guys,.

    I need help.
    first step: I have a drop down list, if I click in the dropdownlist control 'a' and place it in the digital field a number greater than 99, checkbox must be marked and second step: a textfield1 must be visible.

    the first stage works perfectly, but the second does not.
    This is my code for the second stage of the event: java script of change of

    If ((DropDownList1.rawValue == "a") & & (this.rawValue == 1))
    {
    TextField1.presence = "visible";
    }
    on the other
    TextField1.presence = 'hidden ';


    everyone has no idea why?

    Thank you!!

    Diana

    Hi Diana,

    You are on the right track. deleteItem is zero base; so if you want to remove the second point, it would be deleteItem (1).

    I would recommend a script similar to the output from the drop-down list, so that if the user goes back and changes the value, the same logic would apply. Also when you remove items from a drop-down list by using script, it is useful to addItem() again in the other part of the if statement. In this way, you can restore the list because the shape is changed.

    Also I would wrap the script in the numberField in another State to check for null first.

    Attached example.

    Good luck

    Niall

  • When exporting my image in LR I select my brand of water in the drop-down list. Then I need to select 'Edit watermark' since the same drop-down menu in order to replace it. When I do that and click 'done' the watermark disappears in the export me

    When exporting my image in LR I select my brand of water in the drop-down list. Then I need to select 'Edit watermark' since the same drop-down menu in order to replace it. When I do that and click 'done' the watermark disappears in the box menu to export. When I click on "Export" the image exports WITHOUT my watermark. Help, please. As I did about everything that has been suggested in this forum and I still have this problem.

    I saw that too. For now, the workaround is that if you select 'Edit watermark,' when you are done editing be sure to reselect the same watermark. If you do not, the watermark menu will be empty.

    It seems to be a known bug that occurs only in the current version. If all goes well, it can be fixed in the next update. There is a page for her on the Photoshop/Lightroom Feedback site. I've added my vote to the page:

    LIGHTROOM CC - watermark on the question of export

  • Try to fill a text field of a zone drop-down list by using an 'if' statement

    I am filling a text field (modelT) with the text corisponding in the 'data' part of the selectedItem in the drop-down list box. The 'data' appears correctly when I use:

    modelT.text = event.target.selectedItem.data;

    But I'm calling it with an "if" (in red) and subsequently, I can dynamically fill the text field of the multiple drop-down list box. am I missing something simple, here is my code:

    Import fl.controls.ComboBox;
    Import fl.data.DataProvider;
    Import fl.managers.StyleManager;

    var cPurpose:Array = new Array)
    {label: "Execute task", data: "1"},
    {label: "Transportation equipment", data: "2"}
    );
    var purCb:ComboBox = new more;
    purCb.dropdownWidth = 260;
    purCb.width = 260;
    purCb.move (10, 300);
    purCb.prompt = "object of truck?
    purCb.dataProvider = new DataProvider (cPurpose);
    purCb.sortItemsOn ("label");
    purCb.addEventListener (Event.CHANGE, purchangeHandler);

    addChild (purCb);

    function purchangeHandler(event:Event):void {}
    trace ("Selected" + event.target.selectedItem.data);
    purT.text = event.target.selectedItem.label;
    purCb.selectedIndex = - 1;

    If (event.target.selectedItem.data == 1)
    {
    modelT.text = "T660"
    }
    If (event.target.selectedItem.data == 2)
    {
    modelT.text = "W900;
    }

    Thanks in advance for your help

    You must delete or move the following line so that it is not set to zero for the combobox control before trying to read what is selected:

    purCb.selectedIndex = - 1;

  • Using fields show/hide with drop-down lists

    The following code stores and displays the data in a field of view based on what the user selects and it works fine, but I'm not sure how to incorporate additional content in this context.

    Form1. #subform [0]. indPaymentOptions::change - (JavaScript, client)

    Switch - test for the "selected" text, if so, display "display" text

    switch (this.boundItem (xfa.event.newText)) {}

    case "donation/Contribution:

    var display = "Restricted use, usually the student fundraisers. May be a political entity neither does not endorse a political goal. Raised funds donations require a copy of the filing. < span style =------"color: #FF0000;" make-style: italic; ------"> must be attributed to Unassigned funds and senior officer of the authority." </span > ';

    XmlToShow = XmlStart + screen + XmlEnd;

    xfa.resolveNode ("form1. #subform. Display_Field_Pay_Types'). value.exData.loadXML (XmlToShow, true);

    taxReportable.rawValue = 'Y ';

    AccountCodesDynamic.rawValue = "001285;

    break;

    case "Membership":

    var display = 'membership sponsored University must be directly related to the responsibilities of the proposed Member University. Get institutional investors rather that individual memberships to allow the participation of several or another employed. Membership must use a UCSC address for administrative audit. « ;

    XmlToShow = XmlStart + screen + XmlEnd;

    xfa.resolveNode ("form1. #subform. Display_Field_Pay_Types'). value.exData.loadXML (XmlToShow, true);

    taxReportable.rawValue = 'Y ';

    AccountCodesDynamic.rawValue = "001200, \n001210;

    break;

    by default:

    VendPaymentOptions.rawValue = "Please select an option from the drop-down menu"Select type"above."

    taxReportable.rawValue = "";

    break;

    }

    I'm going to show a hidden field, once one of the items in drop-down list is selected with an if statement then. I tried to put the code below in the code above, but it does not work. I am familiar with livescript event management system, so I'm not too sure where the if then statement must be submitted. Should it be set in the * click the section? Or the initialze section? If someone could shine some light on what to do here it would be great.

    If (xfa.resolveNode("form1.#subform.indPaymentOptions").rawValue == 1) {}

    xfa.resolveNode("form1.#subform.textfield1").presence = "visible";

    }

    else {}

    xfa.resolveNode("form1.#subform.textfield1").presence = 'hidden ';

    }

    My example display only text. When you view the drop down from the window of the object, click the link tab. If specify the item values is checked, then boundItem will return what is in the value column during the passage of what is in the text column. If you have added an additional element in the list without adding an item of value, maybe that's your problem. In my example, if you check the box, it will be 1, 2, 3 in the value column. If you then in the code, you have added the this.boundItem part, case sections will have to be changed from 'TextField1' to '1' and the same for the 2 and 3.

  • How do complete you 1 text box with multiple drop-down list values

    I can fill in a text box with a value in a drop-down list, but if I have 2 drop-down list values going to the same area of text (multiple lines), the second drop-down list value removes the first value.

    (A similar code on the drop-down list 1 and 2 from the drop-down list)

    Change event - JavaScript

    If (xfa.event.newText == 'No') {}

    Form1.Page1.subform2.Description.RawValue = "no location listed.

    }

    If (xfa.event.newText == "Partial renting") {}

    Form1.Page1.subform2.Description.RawValue = "enumerated part place."

    }

    Do I have to Concat the fields in 1 text field so that it can have several values in drop-down list, and if so how do I do that?

    Thanks in advance for your help.

    Resolved:

    Place this script in the root of the subform in the FormReady - JavaScript event.

    oList var = this.getDeltas ();

    for (i = 0; i< olist.length;="" i="">

    {

    var oDelta = oList.item (i);

    oDelta.restore ();

    }

    Answer was found at http://forms.stefcameron.com/2008/09/29/restoring-the-of-your-form/

  • Create a secondary named calculation in a repeating subform based on a drop down list?

    Hi all

    I need a little crazy script. Not sure it is even possible.

    What I have:

    1. repeating subform SummarySub amounts
      1. calculation at the end of the form TotalOver field gives the total dollar amount of all iterations of SummarySub

        so far, so simple. but then:
    2. I need another, repeating the SubRow subform at the end of the form to give to other total:
      1. based on the drop-down list the name of the originator in SummarySub
      2. and break out the totals of all iterations of SummarySub based on payer such as chosen by the user names.

    Ideally, the subform (the principal totals) (B) at the end of the form would add instances as the user leaves the field name of the payer. I was not able to find a way to make and to keep the value in the field (name of the payer) of the additional instance.

    All this makes sense?

    I'll appreciate any help.  I'm trying to learn more about JavaScript in LC, but my bills just keep coming...

    Thank you very much

    Laura

    Dropbox - AFBS_OverpaymentReport_121914.pdf

    Hi Laura,

    Take a look at the modified version of your form, https://sites.google.com/site/livecycledesignercookbooks/home/AFBS_OverpaymentReport_01011 5.pdf? attredirects = 0 & d = 1.  I added a subform called PayerTotals, which has a summary of insurance created in his event to calculate.  The code looks like.

    var oFields = xfa.resolveNodes("SummarySub[*]"); 
    
    var nNodesLength = _SummarySub.count; 
    
    var nSum = 0; 
    
    var insuranceCompanies = {}
    
    for (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount++) { 
    
     var item = oFields.item(nNodeCount);
    
     if (!item.InsuranceCompany.isNull && !item.OverpaymentAmount.isNull) {
    
     if (insuranceCompanies[item.InsuranceCompany.rawValue]) {
    
     insuranceCompanies[item.InsuranceCompany.rawValue] += item.OverpaymentAmount.rawValue
    
     else {
    
     insuranceCompanies[item.InsuranceCompany.rawValue] = item.OverpaymentAmount.rawValue
    
      nSum += item.OverpaymentAmount.rawValue; 
    
    totalover.rawValue = nSum;
    
    _PayerTotal.setInstances(0);
    
    for (var insuranceCompany in insuranceCompanies) { 
    
     var payerTotal = _PayerTotal.addInstance();
    
     payerTotal.InsuranceCompany.rawValue = insuranceCompany;
    
     payerTotal.totalover.rawValue = insuranceCompanies[insuranceCompany]; 
    

    Hope this helps

    Bruce

  • How to change or remove a line from a drop down list?

    I have a spreadsheet Numbers drop down box that shows the 3 lines of the text when I start typing the text in the cell. I have to enter the same text 3 times during the construction of the document. How can I remove 2 of these lines of text?

    Hi Brudduh,

    Click the cell that contains the context menu,

    Click on the brush to Format to open the Format Inspector and click cell.

    The Inspector displays the menu items in the context Menu in this cell.

    • To remove a menu item: click on the item to select. Click the button below the list.
    • To edit an item: double-click on the item to select content. Modify if needed.
    • To add an item: click on the button +. Type the content of the element.

    To use the same drop-down list in a different cell:

    • Click the cell that contains the menu to select. Copy.
    • Select the cells to the same menu. Dough.

    Kind regards

    Barry

  • Change an amount (that docks a calculation) based on a drop-down list

    Hi all.

    As I said in the title, I'm trying to dynamically change a field (called CostSalesforce) dynamically from the selection of the field drop-down list (salesforce_company) and have this indictment in a running total that I have form and quantity changes.

    2015-10-22_1343.png

    Fixed the amounts you want to use as the values of export for each of the items in the drop-down list field, and then use this field in your calculation as you would a text field.

  • Please help a poor beginner to open a text box based on a drop-down list

    Hello world

    I am quite new to the life cycle and my experience isn't in the lineup, so I hope that you will be kind to me. I designed a form that we use to send to our Bank to hire contractors. I need to make a text field become visible collection of some inscriptions on the drop-down list. for example, if an entry in the drop-down list "Holiday", I need another text field become visible to the user of maunally enter an extension number. If the user selects, say, "Study leave", I need the text box to stay invisible to the user.

    I hope this makes sense.

    Thank you guys & Gal

    Heavy E

    It is a java script placed on the drop-down list on the change event;

    If (xfa.event.newText is "Vacancy")
    TextField1.presence = "visible";

    else TextField1.presence = "hidden";

    Field1 text is defined as hidden

    To answer your second example, add in the same field:

    If (xfa.event.newText is ' Study/leave')
    TextField1.presence = "hidden";

    If it's confusing, let know us

  • How do you define a table of drop-down list to a specific value boxes?

    I have a table of drop-down list boxes that I want to put a specific value. When I say my program to put them to affect only the drop-down list box which just recently I changed and none of the others.

    I have attached a small vi presents the problem.

    Thank you

    -Ben

    It would be the value - property

  • The drop-down list changes color with background option selected

    Hello!

    I m stuck with this drop-down menu that I need to have a red background, if the TBD option is active (which is the default) and have no backgrond if no other option is selected.

    drop01.png

    drop02.png

    drop03.png

    The red background is a red rectangle that is visible or hidden, I have all code in the event of modification of the drop-down list:

    if (this.rawValue == "TBD"){
        RectangleRed2.presence = "visible";
    }else{
        RectangleRed2.presence = "hidden";
    }
    

    But the thing is that the event checks the value when is changed, so if I'm in the value of TBD and I selected point 1, the recntagle is still visible, because at the moment, I have chosen point 1 value was to be determined, so does not in the way I need to.

    Anys ideas?

    Thank you!

    You must use

    if (xfa.event.newText == "TBD"){
    ...
    

    Then it works fine.

    "xfa.event.newText" evaluates to dropdown in the runtime.

    Hope it is useful,

    Mandy

  • Can not get a text field to atuo fill based on a drop-down list selection

    I have a drop down box with 3 values that can be selected:

    Dropdown2 is 101-3 subd. A

    101-3 subd. B

    101-3 subd. C

    I'm trying to get a field of text automatically fill based on selection:

    If Dropdown2 = 101-3 subd. A Text4 then = 'a. '.

    If Dropdown2 = 101-3 subd. B then Text4 = 'b. '.

    If Dropdown2 = 101-3 subd. C then Text4 = 'ValueC.

    I tried to create a custom for Text4 calculation script:

    var v = getfiled("Dropdown2").value;

    If (v = "subd 101-3. A") event.value ="A."

    ElseIf (v = "subd 101-3. B") event.value ="B."

    ElseIf (v = "subd 101-3. C') event.value = "ValueC."

    else event.value = "";

    I walked into this script and syntax seems to be OK. (At least for Acrobat XI.  I'm not know programmer and have just enough knowledge to be dangerous).  When I select a value in Dropdown2 nothing happens.  No value appears in Text4.  I checked the "selected value immediately commit" in the Dropdown2 option by google'ing.  I don't understand why the values do not appear.  Any help would be appreciated.

    Thank you

    You made a mistake... The comparison operator is "is" (or ' = '), not of '=', which is used to assign a value.

    So replace all these:

    If (v = "subd 101-3. A")

    To do this:

    If (v is "subd 101-3. A")

  • Auto-fill form fields based on the input from the end user?

    I am currently trying to create a new form that has a combo box 'Locations' with various options.  What I want to do, is to have another car to text field to fill out other fields associated with this location (for example, address, contact information) to save on time and reduce the possibility for the end user input errors.

    What are my options to accomplish such a task?  A form of bonding in the fields with a database of MS maybe?

    Thanks in advance for all advice and assistance on this subject!

    I created a sample for you... are a look and let me know if this is the case for you.

    Paul

Maybe you are looking for

  • How to retrieve a dead computer favorites.

    My computer crashed and it took several valuable bookmarks. I used Firefox OS. Now I have a new computer and use Firefox OS. Can I retrieve the bookmarks on the dead computer and store them on the new?

  • Can not access the recovery on M30 partition

    Hi all I use a Toshiba M30. Last week, I uninstalled the old version of Norton Antivus to install the new version of Norton Internet Security. After you have uninstalled the NA, I found that my phone does not work normally. I, therefore, formated C p

  • HP250G4 (M9S81EA): the laptop computer does not see the usb cable

    Hello, have a problem with HP250G4 (M9S81EA), doesn't want to install cable diagnostics. After you install the cable drivers, win10-64 cannot define it. All the drivers are installed on your laptop and work properly. The cable is the same worker chec

  • recovery disc help please?

    What model name and number is your office? Compaq sr1930t What operating system is installed? Windows xp I ordered the HP recovery disk. It took 3 hours and a half for me to end with all the 15 disc. I followed the instructions and pulled out the las

  • In XP, I returned the mode display landscape to portrait mode. How to get landscape?

    By pressing certain buttons trying to create symbols in Spanish, I made my desktop display go sideways (portriat view) I don't know where start return to the normal display (options under 'view' that will do that. Help!