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.

Tags: Adobe LiveCycle

Similar Questions

  • Show/hide all drop-down lists

    Hi all

    I got up to put up a button of toolbar to show or hide all sections of the drop in my content, according to the guide here: http://www.grainge.org/pages/authoring/showhide/toolbar_method.htm.

    Since my upgrade to v7, this doesn't work anymore...

    Does anyone know how to get it going again, it's a feature I use a lot!

    Thank you, Mark

    I just wanted to add here that Peter has solved my problem... for some reason, the fact that my subjects have 2 meta tags, showing that they were imported from Word documents broke the function show/hide.

    By removing these 2 meta tags, the functionality is restored...!

    Thanks Peter!

  • show/hide fields based on the drop-down list of choices

    I have a field from the drop-down list with three choices. Based on the selection, I need a specific text form field to appear and the others to stay hidden. (Or if it makes the code cleaner, the resulting field could be a drop-down list, too, with the selected choice.) I don't know Java well enough to extrapolate the code from the examples online and it fit my forms. I can provide an example of form. Thanks in advance for your help.

    There are ways to run this.  the easiest for you would be to add this script to the event (calculation of the Properties tab) to calculate the field that must be hidden.  Take notes, all "/ /" is some tips for you to understand the code.  You will need to put this script in all the areas you want to replicate the behavior, change the value depending on what you want to accomplish.  the word 'event' means myself to make you understand.

    If (this.getField("dropdown").value == 'put value here') {//replace "drop down" with the name of the drops}

    Event.Target.Display = display.visible;

    }

    else {}

    Event.Target.Display = display.hidden;

    }

    This works if you have a small amount of fields.  If you manage to have a large number of similar fields, let me know because there are other, faster ways.

  • 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;

  • Search with drop-down list box

    Hello, I am looking to build a Web site for real estate agent and I need to know how I could do a search box with drop-down list according to the image below?

    is there a widget for it?

    Please, if you know a tutorial for that or something Visual on how to let me know

    Screenshot_4.png

    Here are the options available through widgets in Muse:

    http://musewidgets.com/products/data-table

    http://musewidgets.com/products/addsearch-button

    http://musewidgets.com/products/addsearch-Widget

    For a more exact search with custom field values, you can create web app items in case you are using Business Catalyst for hosting your site.

    Thank you

    Sanjit

  • Show/hide fields based on the drop-down list

    Hello

    I'm trying to show/hide subforms with a drop-down list selection. I found a lot of information on the subject and ended up with what my script:

     form1.Page1.Division::exit - (JavaScript, client)
    
    switch (Page1.Division.rawValue)
    {
       case "1":
       SubformZZI.presence = "visible";
       SubformZZR.presence = "hidden";   
          break;
     
       case "2":
       SubformZZI.presence = "hidden";
       SubformZZR.presence = "visible";       
          break;
    }
    
    

    However, it does nothing when a selection is made in the drop-down list. I have the "SubformZZI" initially defined as 'Visible' and the 'SubformZZR', originally defined as "hidden".

    Any suggestions?

    Kind regards

    ZeroZone

    Check if the form is saved in dynamic form. File-> save as and choose dynamic for the type of shape...

    Other that that, you should check if you have given the values for the selection of the drop-down list as '1' and '2' in the tab of the control's binding.

    Thank you

    Srini

  • Problem with drop-down list that prevents the use of the functions, will not go away.

    Hello

    I have Windows 7.  I could not afford MS Office, so I downloaded OpenOffice and, later, LibreOffice.  My problem is, when I open a document to write in a program, a drop-down list (formatting) is displayed.  It starts with "Default" at the top.  The box does not work, if I click on anything that it just flashes.  Or it will disappear.  I tried everything I can think of to get rid of him.  And, as long as it's here, I can't write to a document.  I can close, but only by closing the program.

    Is this problem only with free Office programs.  Sometimes when I am looking for a program in Windows 7, or if I'm looking for the Help menu in 7.

    I'm not very savvy computer.  If you would be interested to help me, thank you very much, but please don't expect me to know some thing on anything whatsoever.  I used to use the mode BACK back in the day, but the subterrain of computers is a subject that I've lost contact with long ago.

    You can also try to test with another Windows user, in case you have a corrupt user profile.

    If things were OK and then maybe a few days ago, System Restore is an option.

    How to repair the operating system and how to restore the configuration of the operating system to an earlier point in time in Windows Vista (or 7)
    http://support.Microsoft.com/kb/936212/#appliesTo

    Don't you see the same problems in Mode safe?

    Startup options (including safe mode)
    http://Windows.Microsoft.com/en-us/Windows7/advanced-startup-options-including-safe-mode

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7
    http://support.Microsoft.com/default.aspx/KB/929135

  • Hide the drop-down list when you print only when "PLEASE SELECT" is selected (unused field).

    Our form has several drop-down lists that by default the option "Choose", and not all of them are used whenever the form is used.  When we print a copy of each document, we would like the (unused) field "Choose" to disappear when printing - to make a copy of paper filter.  Is there a script for this?  I tried to use only the general framework ' Visible but does not print ", but of course, the field prints any - we need to print only when there was one another option as the default"Select"is selected.  Thanks in advance for your help.

    Coleen

    You can use a custom validation script, something like:

    Event.Target.Display = event.value = "choose"? display.noPrint: display.visible;

    To put this into effect, you will need to make a different choice and place it back to "choose." Another option would be to place as a custom Format script.

  • still problems with drop-down list fill the Script

    Well, I used the information I got this forum to fill a drop in a repeatable subform with javascript (and it even works with FormCalc) problem solved. But now when I test the script in format acrobat (with calculations) the last item on my list does not seem to be working properly. They are scripted like that on the preOpen event.

    DropDownListName.additem ("item 1", "1.00");

    DropDownListName.additem ("item 2", "2.00");

    etc.,

    etc.

    They are all the same, and they all show during the test. But when I click on the last item, it automatically entered the first element on the form and for some reason that I don't know, when I click on the arrow to the bottom of the drop-down list once again, will be my listed items 1-6 and 1-6 new (Double listing the items). If I click it a third time he triple will list the elements... Weird! Maybe I'm just tired, but more probably think I do something wrong (again!) Anyone have any ideas?

    One more thing so I don't have to add another post and I hope you people leave him alone. How do the total field sum of script so we round to the nearest cent (1.856 = 1.86) or which is not easy

    Hello

    The second issue of additional items in the drop-down list is easily sorted by including a line in the preOpen to clear the list first.

    DropDownListName.clearItems ();

    This should go before the addItem script.

    This erases the existing list, before be filled again. You would tend to use addItems, where list items will change according to the previous intervention of the user with the form.

    Regarding the round total, you can do this with script (check "Round" in the help file), but it is not necessary.

    When you have the total selected object, just go to the object/field tab and click models. On the display tab, you can select a model of currency with the currency symbol, the 2 decimal and thousands separator (IF your item is a numeric field).

    Good luck

    Niall

  • Automatically populate a drop-down list by using another selection from the drop-down list box

    New java/preparation forms so I apologize in advance.

    I currently have a menu drop-down box 1 (Occupation) with three options: "enter your own description/blank", retired housewife. When someone chooses either retirement or anyone at home, I would another drop box 2 (employer) to assign automatically "n/a. . The employer drop box has only two options: "enter your own/blank", N/A.

    Far, I could for that box to fill but only when the person clicks in the box (as if they were about to enter their own text.) Then only it will fill the drop-down list "employer." I would like it auto fill once the person has chosen retired, Virgin or stay-at-home woman without having to enter in the box (just using the arrow to the size of the drop-down list box).

    I currently have a key shot that resets the employer box when a person chooses the option vacuum/enter your own option. I then a JavaScript (only for the housewife now) that only works if you click the box of. Key combination works I want to than the other options work as well. If the client settles on white, the choice of the employer updates automatically empty without having to click in the box of. Any help (including general advice to make my code cleaner) is very appreciated!

    Current script of typing:

    If {(event.willCommit)

    If (event.value == "") this.resetForm (["use"]); of other SetFieldValues (event.value);

    }

    The current upward, mice running JavaScript :

    var v = this.getField ("Occupation") .value

    If (v is "Housewife")

    1. this.getField("Employer").value = "N/a".

    I think maybe I should use event.willCommit in my formula, but I'm not sure how to include it.

    Thank you!

    I would not use the key sequence or MouseUp actions for this, but the action post.

    Just make sure that you set the field option to validate the selected value immediately (under Properties - Options) and then use this code as the custom validation script:

    var employerField = this.getField("Employer");
    if (event.value=="Homemaker" || event.value=="Retired")
        employerField.value = "N/A";
    else employerField.value = employerField.defaultValue;
    
  • Help adding textfield with drop-down list selects

    I have a PDF with a drop-down list field called "SoftwareList" with a default value of "Select the software" and a text field called 'SelectedSoftware '. You can freely type in the text field to communicate your needs, or choose the menu drop-down. I want to add in the text field, which is selected in the drop-down list each time. I had the following script to fix this as a custom text field calculation script:

    If (this.getField("SoftwareList").value! = "Select software")

    {

    this.getField("SelectedSoftware").value += this.getField("SoftwareList").value + «»

    }

    The problem I have is that it will continue to add to the text box with everything that was selected last in the drop-down list when you click on other fields in the form, such as check boxes. I tried this put on different actions both at the key sequence in the Properties tab of format, but did not work there. I added the following line, which helped, but it is still a click of the addition until it changes, duplicate the last pick:

    this.getField("SoftwareList").value = "select the software."

    Appreciate help with this.

    I would like to use the script validation custom from the drop-down list. You can use something like this:

    If (event.value! = 'Select Software') this.getField("SelectedSoftware").value += event.value + ",";

    To ensure that the update as soon as a selection is made to check the option to validate the selected value immediately under properties of the menu drop down, tab Options.

  • 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

  • Fill in numeric fields according to the drop-down list

    Hello

    I am VERY new to Adobe LiveCycle so be gentle. I am trying to generate a purchase order. I made my drop-down menu with all the elements that they can choose to buy. I want the the user can select an item and have the corresponding prices for this item to be brought up in a column of prices, then the user can change the quantity and then the Total price column will calculate the price and quantity.

    Can someone help me with this? I drive myself nuts trying to figure it out on my own.

    Thank you

    Amy

    PS. I don't know how to write the script if it's what I do... Sorry

    PLLEAAASEE HELP

    The simplistic way to do is to assign prices as the values of the drop-down list in the "Binding" tab of the object palette.

    Then, in the case of calculating of the price (using formCalc) simply the name of the drop-down list field.

    When the item is selected, the price will appear in the price field.

    Good luck!

    Stephen

  • 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

  • Fill in the cc field, based on the drop-down list values

    I know this question has been posted before, but I am very new to this, and the answers I found to date are over my head.

    I am trying to create a submit button that will not only send email to a specific address, but also the carbon copy someone when their name is selected from a drop-down list in the form.

    I don't know much about javascript - and this seems to be the way to achieve this - but I do not know where to enter the JS to get this functionality or syntax. The field I use is called "Supervisor1", and I attributed values (e-mail addresses) to each of the names in the menu dropdown.

    Can someone help me get there?

    Thanks in advance!

    Hello

    If you are a beginner of script, you might think this useful macro.

    It can add a script to mail to a normal button.

    http://thelivecycle.blogspot.de/2012/05/mailto-maker-Marco-v1.html

Maybe you are looking for

  • 2575 all-in-One printing envelope of irregular shape

    Try to print a 4 "x 5" envelope, I get an error on the printer saying paper is incompatible.    The envelopes are MS Word documents and I set the paper size in Word to the closest size to envelope, 4 "x 6", but still not the error. Douglas Hall

  • Can I install Windows Vista on my A110-178

    People, I am in possession of a laptop Toshiba Satellite A110-178. I would like to know if I can install Windows Vista on this laptop? And what version, Home Basic, home premium, ultimate or business. Kind regards Tim Snijckers

  • dc5850: DC5850-SFF transfer to a new tower/case components

    I have a HP DC5850 SFF and I am wanting to transfer all the internal elements to a new tower with a new power supply.   This motherboard will be mounted in an ATX case?

  • I have a Pavilion dv6. The test of hard drive reads: SMART Long DST passed, short DST passed, and failed.

    I have a HP Pavilion DV6 and it will DISPLAY, allow me to connect, and then reading welcome with the busy symbol, then the screen goes black.  My pointer always recognizes the touchpad and moves accordingly.  I've performed memory tests and received

  • Downloaded freeware PDF24

    I downloaded pdf24 from the internet, but could not remove it using the Windows 7 uninstaller function.  I deleted the file but still had the pdf24 in the submenu right click for pdf and excel files even after the deletion of references to pdf24 cont