Text of field force based on list drop-down choice

I adapted this from an example provided by pguerett call 'health mental-check' (in another thread that I can't find right now) who performed a similar function based on a checkbox control.

I have a dropdown list with a change event to set the menu text focus IF the drop-down list item is replaced by 'others '.

In the text field, that I have an output event which 'should' give a popup message and then set the focus on the field from the drop-down list, IF the drop-down list item is "other", AND the field is null output.

However, this does not go as planned.

Any help would be greatly appreciated.

Thank you.

Part of it is to get your '=' and '==' mixed up. A = to assign the value, two == to compare a value.

I think the gasket you need.

I changed your script:

var newValue = this.boundItem(xfa.event.newText);
if (newValue == "Other")
{
    xfa.host.setFocus(form1.IncidentReport.OtherNature);
}

I think the way it works is that you'll need to capture specific value selected in the drop-down list, because it is has been selected the value does not exist in the field again... or something like that - someone else here can probably explain it properly!

Tags: Adobe LiveCycle

Similar Questions

  • Insert the subform based on list drop-down choice

    Is it possible to insert a subform of a choice of menu drop-down. I have attached a sample of what I am trying to accomplish. When you select Yes in the drop-down list the subform becomes visible. What I want is when the selection is not, so there is no space between the next set of questions. This form extends on more than 5 pages.

    Can be done with the following steps.

    1 record under pdf dynamic rather than static.

    2. change work subform presence of Invisible to hidden (exclude from layout) in your form.

    Please check the pdf seal updated.

    Rambeau.

  • The floating field value based on the drop-down list selection (sex)

    Hi, I have created a form that will have different fields, dropdowns etc where the answers will fill a range of fields floating in a letter. I would like to have a list drop-down for sex (m/f) and if selected, either fill in the letter as 'he' or 'she. ' Is this possible?

    Hello

    Here are some ways to do it in this sample https://sites.google.com/site/livecycledesignercookbooks/home/HeShe.pdf?attredirects=0&d=1

    Unrolling of male/female can have a bound value from it, which means we can do refers to the value directly, without however going any calculation.  Is there are a lot of places where it needs to be replaced, then you can simplify things by making reference to the field to form directly, although this requires to change the XML, but if you won't find yourself with a hidden for each instance field.  Or you could edit the XML Source and change the reference for the same id of a floating field.  There are examples of both in the sample linked above.

    Concerning

    Bruce

  • How to change a text field value based on a drop down menu?

    Hello experts.

    I have a simple form with a very long drop-down list, and two text boxes.  I use a table to fill textbox1 based on the value selected in the drop-down list, and it works as expected.  Some of the values in the drop-down list, but not all, should cause textbox2 become unalterable.

    Does anyone have an example script for this?  Any help would be greatly appreciated.

    I use LiveCycle Designer ES 8.2 on Windows Vista 32 bit.

    Thank you

    Jerald

    You can do the TextField2 as readonly using the Script based on the value in the drop-down list.

    If (dropdoqn1.rawValue == "") {}

    TextField2.access = "readOnly";

    }

    You can modify the script above that you need...

    Thank you

    Srini

  • Show/hide multiple fields on list drop-down choice to help if else

    Goal is to display or hide the three fields according to a choice of menu drop-down. If show X, hide if Y.

    How a syntax on line error 6 when adding to the trigger mouse-to the top of the field drop-down list.

    Are several actions allowed for each if condition?

    if(event.target.value = "Yes")
      getField("Top_inches").display = display.visible;
      getField("Top_numerator").display = display.visible;
      getField("Top_denominator").display = display.visible;
    else
      getField("Top_inches").display = display.hidden;
      getField("Top_numerator").display = display.hidden;
      getField("Top_denominator").display = display.hidden;
    

    You have at least two syntax errors. The first is that you used the wrong operator for comparison. 'Is', not '=' (this is the value assignment operator).

    The second is that you did not put blocks of code inside the curly braces.

    If your code should be:

    if (event.target.value == "Yes") {
        this.getField("Top_inches").display = display.visible;
        this.getField("Top_numerator").display = display.visible;
        this.getField("Top_denominator").display = display.visible;
    } else {
        this.getField("Top_inches").display = display.hidden;
        this.getField("Top_numerator").display = display.hidden;
        this.getField("Top_denominator").display = display.hidden;
    }
    
  • Need help to make the field required, based on the drop-down menu ' YES/NO' other please field

    field 'A' - drop down, YES/No.  Field 'B' must be entered if 'A' = 'YES '.  If 'A' = 'NO', then 'B' as a default of 0. If "A" = "-", then "B" is "-".

    Really, I hope someone can help, Ive tried java, etc. action buttons.

    Thank you

    To set the property of the EmployeeID field B use the following that the validation of your menu script drop-down:

    this.getField("B").required = (event.value == "YES");

    As noticed TSN, the required field only comes into play when the record is submitted (and only when it is done using the built-in command to submit, do not use a script).

    However, it is possible to use a script to inform him that the use that the file is not correctly filled in when the file is printed/saved and even to reset the form entirely in this case.

  • ADD ITEMS TO THE LIST DROP-DOWN LIST TO A TEXT FIELD (USER ENTERS THE ITEM) AND ALSO RELATED TO VALUE

    Untitled.jpg

    I have WANTED to ADD of ELEMENTS from the list drop-DOWN OF THE AREA of TEXT (the ELEMENT NAME) WHERE the USER BETWEEN of THE DESCRIPTION of POINT

    AND RELATED value SHOULD ALSO BE ADDED to THE SAME ELEMENT.

    LIKEWISE REMOVE ITEMS IN THE DROP-DOWN LIST

    PLEASE GIVE SHAPE TO SAMPLE OR JAVASCRIPT FOR THE ABOVE SCENARIO...

    INDEED USEFUL FOR MY PROJECT PLEASE SEND PDF FORM

    Hi Praveen,

    You can add items to the list in a specific order, which would be to load the elements in an array, sorting and then load in the dropdown list drop-down list.  This would be in the click event of the button Add.

    Create a table to hold all the list items, table drop-down list contains objects with a property 'displayItem' and 'value '.

    dropDownItems var = [];

    Add the new

    dropDownItems.push ({displayItem: ItemName.rawValue, value: BoundValue.rawValue});

    Add existing ones

    for (var i = 0; i)< dropdownlist1.length;="">

    {

    dropDownItems.push ({displayItem: DropDownList1.getDisplayItem (i), value: DropDownList1.getSaveItem (i)})

    }

    Sort by ascending order of displayed text

    () dropDownItems.sort

    function (a, b)

    {

    If (a.displayItem< b.displayitem)="" return="">

    If (a.displayItem > b.displayItem) return 1;

    return 0;

    });

    clear all items

    DropDownList1.clearItems ();

    load the sorted items

    for (var i = 0; i)< dropdownitems.length;="">

    {

    var dropDownItem = [i] dropDownItems;

    DropDownList1.addItem (dropDownItem.displayItem, dropDownItem.value);

    }

    clear the fields of the source

    ItemName.rawValue = null;

    BoundValue.rawValue = null;

    I added a button 'Add' sorted in my sample https://workspaces.acrobat.com/?d=OwysfJa-Q3HhPtFlgRb62g

    Concerning

    Bruce

  • 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

  • Different calculation based on the drop-down list

    I'm trying to figure out how to change the formula of a derived field in the selection in an adjacent drop-down list.

    For a simple example, trying to find the total amount paid on a loan, would you go Total paid = capital + (main * Int * time). But you may pay more depending on if you pay a fee.

    So what I have works when I enter the formula in the field "Total paid", but trying to integrate the list drop-down for the fees (which is either "Yes" (value = 1) or "No" (value = 2)), I can't figure out how to add the tax, which is $ 50.

    In the drop-down menu, I like an output event:

    Switch (this.rawValue)
    {
    case '1 ':
    totalPaid.rawValue = capital + (Principal * (rate / 100) * time) + 50;
    break;

    case '2 ':
    totalPaid.rawValue = capital + (Principal * (rate / 100) * time);
    break;

    }

    Could someone take a look at this and tell me what I'm doing wrong? I'll post a link to the form that you can see the details (if I do this right!)

    https://Acrobat.com/#d=L7YF3np55Dc7aBOM46qITw

    Thank you!

    Hello

    You just need to use .rawValue to access the value of each object.

    Here is the form to the you: https://acrobat.com/#d=7J3ho * YeHyJzQLK1AEFtWw

    Good luck

    Niall

  • List drop-down list of reading value

    Hello

    I have a button and a drop-down list in the next row under drop downgrade, at the click of the button, I want to display value based on the drop-down list. Is there a way to read/extract value from list as and when the user click on it. I don't want to leave the screen, but offers more functionality for the user. It is not enough for me:http://docs.blackberry.com/en/developers/deliverables/17971/Create_a_drop-down_list_509565_11.jsp

    This article suggests ObjectChoiceField for a drop-down list, which already has what you are looking for:

    getSelectedIndex() and getChoice (int index). To seize the moment of choice being made, use FieldChangeListener.

  • Mobile side.  Using the drop down of your video.  I once put some text on the Mobile page the Menu drops down, but behind the image.  When I remove the text box the menu works correctly.  This also happens with a HTML code placed to Paypal.

    Mobile side.  Using the drop down of your video.  I once put some text on the Mobile page the Menu drops down, but behind the image.  When I remove the text box the menu works correctly.  This also happens with a HTML code placed to Paypal.

    Please check layers panel and put in place the menu item in the list, you can use the layers panel and move up or attempt to move the content.

    If there is still the same, then download a few screenshots of the design view.

    Thank you

    Sanjit

  • list drop down background color of paper list

    I have a form with fields about 500.  The drop-down list fields (20 of them) all print with a blue background, dark, even with the properties defined on any background color.  None of the other fields print with a background color. No idea how I can eliminate this boring action in Acrobat Pro XI?

    Yes, the color you see is selected items in a list box. It can not

    be changed. Just change them to a drop-down list field to get rid of him.

  • Problem of not seeing list drop-down connection to the wireless network when checking connections network - pc windows 7.

    Problem of not seeing list drop-down connection to the wireless network when checking connections network - pc windows 7.

    I just installed a Belkin modem-router - which went well. Can I connect WiFi gadgets etc. I can also connect to the internet via a network cable to my pc. I also installed a belkin usb wireless adapter and in Device Manager, says it is enabled and works.

    My problem is, I have no way of choice get a WiFi PC to display in the list (from the notification area) and cannot get the pc to give me options to create a wi - fi connection. The more I get to try to do that is "unexpected error"!

    If someone could help on this - I would be very grateful

    Good news - update of my ongoing saga with this Belkin modem/router.

    Got the pc to see wi - fi now. It turned out to be the Zone Alarm! As the router has a firewall, I uninstalled Zone Alarm completely. Also, I went into the properties of belkin usb and checked it was the most recent drivers, it does not so I installed them.

    So far so good

    Thanks for the help

    TREV Smith

  • 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")

  • JavaScript to fill the text based on the drop-down list field

    Hello

    I'm trying to write a javascript script to fill a "Textfield" based on what I select in 'Dropdownlist control' this has on a relationship between them. I tried to integrate the script on the category of 'Change' and the script was the following, but it didn't work. I would be grateful if someone can help me with the correct procedure.

    Thank you

    Vijay

    Form1. #subform [0]. DropDownList2 [0]: change - (JavaScript, both)

    function populateDescription() {}

    if (document.subform [0].) {DropDownList2 [0] .value == "BIH")}

    document.subform [0]. TextField83 [0] .value = "Burn in and PBI history."

            }

    }

    I solved this problem by using a script to switch.

    Please see my previous thread in this regard and Paul example will provide you with the right script for a script to switch.

    http://forums.Adobe.com/thread/479021

    script on the drop-down list as follows

    Switch (this.rawValue) {}

    case "dropchoice1".

    FieldName1.RawValue = 'choice of text here ';

    FieldName2. RawValue = "choice of text here ';

    break;

    case "dropchoice2".

    FieldName1.RawValue = 'choice of text here ';

    FieldName2. RawValue = "choice of text here ';

    break;

    }

    Good luck.

Maybe you are looking for