Code JavaScript for buttons, drop-down lists, and text fields

Hello, I currently have a form with a drop-down list field that fills a text field with something according to what is selected in the drop-down list via a custom script typo.

I want to add a button that something will enter the field of text according to what is selected in the menu dropdown. Copy and paste the script of hitting into the button do not work and returns an undefined value.

I would also like to add that I am new to coding and it would be more useful if someone can provide a script for it or let me know if this is not possible. Thank you.

OK, the script of mouse upwards for the button might look like this:

(function () {}

var aQuotes = [];

aQuotes [0] = this.getField("Batch").value = util.printd ("Rmmddyy-96", f);

aQuotes [1] = this.getField("Batch").value = util.printd ("Rmmddyy-95", f);

aQuotes [2] = this.getField("Batch").value = util.printd ("Rmmddyy-94", f);

aQuotes [3] = this.getField("Batch").value = util.printd ("Rmmddyy-93", f);

aQuotes [4] = this.getField("Batch").value = util.printd ("Rmmddyy-92", f);

aQuotes [5] = this.getField("Batch").value = util.printd ("Rmmddyy-91", f);

aQuotes [6] = this.getField("Batch").value = util.printd ("Rmmddyy-90", f);

Get the value (export) of the element selected in the drop-down list

var point = getField("dropdown1").value;

Set the value of a text field

getField("Batch").value is aQuotes [point];.

})();

Replace "ListeDéroulante1" in the code above with the actual name of the relevant drop-down list field.

Tags: Acrobat

Similar Questions

  • Simple javascript for the drop-down list IF, fills two different fields

    I don't write js, but can grasp what it did when I hang a sample edit and re - purpose. I have a form simple fax that already resets to the opening. Here's what I'm doing:

    User selects the sender's name in the drop-down list of about 15 (grow w / hour)

    Fill in the following text field "sender Fax #" with the number of direct fax (xxx-xxx-xxxx in the js) user

    Are also complete this later text field "sender Ph #" with the number of direct ph of the user (xxx-xxx-xxxx in the js)

    Here is an example which I believe works the way you want: https://workspaces.acrobat.com/?d=gZNDS8dQQNqvwocUufXHNQ

    You have to watch the fields to see how they are implemented and to study different scripts to see how it works. If you have any questions, post again.

  • Button Drop Down List Style

    I use Adobe Captivate 8 and I don't see an option to style the button for a drop-down list.  I see that I can change the color of the font but not:

    • the color button (which is now a dark gray)
    • the size of the font (which seems to want to stay to 14.0)
    • the background colors for the menu drop-down (currently some blue and white for unselected options)

    I looked in the topic Manage settings of objects, but can't see all the options for the style of the widget.

    Can someone please confirm if the style is possible or not, thank you.

    As Rod replied CO terminology can be very confusing. I know as well

    that the interactions of the so-called are widgets, assured to be HTM L5

    compatible against the old widget. Extension can be the same, but angry

    they are in different folders. Interactions are both in a Gallery folder

    and a copy in the users folder, where updates are as followed. Widgets

    are only in a subfolder to the gallery.

  • Problems with HR 9Printed Documentation do not display windows popup, drop-down lists and links

    Generate a Word document for reviewers. PrintedDoc properties include: maintain links Hypertext; Include text from the drop-down; Include text enlargement.

    • Sometimes the Word 2010 document contains links, sometimes it doesn't.
    • Pop-up windows does not work normally in the document Word.
    • Menu drop-down and expanding text appear intermittently in the Word document.

    Has anyone experienced this and have a solution?

    Thank you.

    Carol

    I have never known failure except in two cases, hyperlinks.

    1. The target field is not in the printed document. It cannot obviously a link to something that does not exist.
    2. The hyperlink is a popup.

    Not sure what you mean by popups not working only not in a printed document. If you mean that links to these break, then see above. Known issue.

    I don't know why you are having the drop down list, growing problem of text that I didn't know that it is a problem either. Is it always the same drop down menus that fail? Have you compared a good drop-down list and a bad dropdown?

    Take a look at the Documentation printed on my site.

    See www.grainge.org for creating tips and RoboHelp

    @petergrainge

  • How to change values from drop-down list in several fields simultaneously

    I have a 50-page form that contains a multitude of areas.  One of the fields from drop-down list is repeated throughout the form.  The values in the drop-down list options must be the same for all fields of form drop-down list.  These fields are not copies.  I need to make them individually selectable with touching other areas.

    The problem is, I often have to update the values in these fields... and there are dozens of them.

    Is there a way to store the list in the document and have all dropdowns access from this central location?

    You can do quite easily with a script. For example:

    var aList is ['Alaska', 'Washington', "Oregon", "Idaho", "Montana"];.

    getField("dropdown1").setItems (aList);

    getField("dropdown2").setItems (aList);

    Add any other dropdowns here

    You can store this code in a JavaScript function at the level of the document and update it and then call it whenever you need to update the drop-down lists. If you need to include the value of exports for the elements, you need to change the table suruneliste to an array of arrays, something like:

    aList var = [['Alaska', 'AK'] ['Washington', 'WA'], ['Oregon', 'GOLD'], ['Idaho', 'ID'], ['Montana', 'MT']];

  • How to use spawning with a drop-down list and a table area

    Hello

    I have a form that I need to build pages.  As it is now, I have a table in document and a drop-down list box.  When a selection is made in the drop-down list box, the StateAmt field is filled with the table.  This set works fine now, but I need to be able to make this code work with pages having engineered and need a bit of help.

    It's my javascript document:

    var gState = new Array //Create a reference to a new array

    load the table with quantities for each State

    gState ['AL'] = 40

    gState ['AK'] = 40

    gState ["AR"] = 40

    gState ["z"] = 25

    gState ['CA'] = 25

    .. .and so on, I deleted the most to make the shorter script here

    It's my script custom shot to a combo box "gstate" (FYI, I've added the initials of the State in the tab options in combo box)

    var stateamt = this.getField ("G876. StateAmt')

    If (event.changeEx to gState)

    stateamt. Value = gState [event.changeEx]

    This works very well for one page, but when I add another page (model laid) nothing happens after you make a selection in the drop-down list box.  I don't know I need to edit the script due to spawning change the domain names on each page, but I don't know how.  I tried to rename the combo gState1 and using this script (which does not work)

    Fna var = event.target.name.split(".");

    var fp = fna.length > 1? "fna [0] +". ' ' + fna [1] + ". » : » « ;"

    var stateamt = this.getField(fp_+_"G876_StateAmt").name / / (this is G876. StateAmt in the original formula)

    var = this.getField(fp_+_"gState1").name //(this is gState GST on the original form)

    If (event.changeEx in GST)

    stateamt. Value = gst [event.changeEx]

    If anyone can help me with this, I would be very grateful.

    Thank you

    Lisa

    I fugured it myself. It works:

    Fna var = event.target.name.split(".");

    "var fp = fna.length > 1? fna [0] +". ' ' + fna [1] + ". » : » « ;"

    var stateamt = this.getField (fp + "G876_StateAmt")

    If (event.changeEx to gState)

    stateamt. Value = gState [event.changeEx]

    I didn't totally understand the script and trying to change the wrong part.  It is still using the gState table and I needed to change the text box to get the information in the table.

  • Is it possible to add images/icons for a drop-down list box?

    I have created a form with several fields of text. The customer wants to be able to 'mark' some/all the of them with an icon (until there are only two icons of your choice)

    Due to the limit "real estate" on the form, it would help a lot if I could add these icons to a simple drop-down list. Unfortunately, I found no way to do it.

    Such an option exist?

    ... and if so, how?

    Thanks for any help or information

    No, but you can use a button to display images/graphics. If you are using JavaScript (for example, app.popUpMenuEx) to view the selections of text after you click the button, the script will mark the button icon to the corresponding selection. There are other similar types of things that would make with the buttons, but all rely on JavaScript. Note that this type of approach does not work on most mobile PDF viewers and not Adobe PDF viewers.

  • How to restore the search bar drop-down list and the search engine icon today as it was in version FF 33?

    Some ealier time, I managed to go back to the drop down list via editing about: config and setting browser.search.showOneOffButtons to false.

    But yesterday firefox asked me to improve my search and I agreed. After that, I see ugly new tile instead of the drop-down list.

    How can I go back to find it is old menu drop-down appearance?

    "browser.search.showOneOffButtons" was a temporary pref which lasted from Firefox 34 upward through 42 of Firefox. The underlying code that have supported this preference is gone like Firefox 43.

    https://addons.Mozilla.org/en-us/Firefox/addon/classicthemerestorer/ has an option for old search (experimental) in Options of CTR > UI (1)

  • Select from a drop-down list and the specified element values are displayed in the textfield

    I need for one to be able to select from a list drop-down and specified the item values appear in textfield.

    For example, if I select Amy

    If I select Bob

    If I select Jane

    Amy

    Bob

    Jane (I want to appear as shown in the list)

    I associated a value to each item in the drop-down list so that the choice is easy to compare and determine what initial (default) value to the value in the text field. In my drop down list change event, I have the following:

    var sNewSel = this.boundItem (xfa.event.newText);

    Switch (sNewSel)

    {

    case '1': / / Amy

    TextField1.rawValue = "Amy \n";

    break;

    Switch (sNewSel)

    {

    case '2': / / Bob

    TextField1.rawValue = "Bob \n";

    break;

    Of course that's not work one name shows at a time. Help, please!

    Thank you

    Don't know what the code is supposed to do, but basically, you want to add the name of the drop-down list the addition on the current value of the TextField? Why not use the dropdownlist display value directly? For example on the change event:

    if ( TextField1.rawValue == null )
        TextField1.rawValue = xfa.event.newText;
    else
        TextField1.rawValue += ( "\n" + xfa.event.newText );
    
  • Choose a value in the drop-down list and sumbit

    Hello

    I am completely new to the forms and javascrpit so my question is very simple:

    I created a drop down list with names.

    I want to push a button and submit the pdf doc to the letters to the coresponding name from the drop-down list.

    My code

    ……

    var aa = DropDownList1.rawvalue;

    var bb;

    If (aa = 'George') {bb ="[email protected]" "}

    ElseIf (aa = "Nikos") {bb ="[email protected]" "}

    event.target.mailDoc (true, bb, "", "", "PDF form is returned");

    ….

    The code has no bugs, but after pressing the button, the pdf is sent allways to [email protected] . He behaves as if I said a constant bb ="[email protected]"" "

    It does not take into account the value in the menu drop-down

    Could you please help me?

    Concerning

    There is a second bug in your script, I have identified no before.

    var aa is DropDownList1. rawvalue;

    should be

    var aa is DropDownList1. rawValue;

  • Using drop-down list and the required fields

    I am trying to create a timesheet in Livecycle to replace the current form I have in Excel. I'm still a beginner w / LiveCycle and this is the first question I've had for some time. I have problems that require a field based on a choice.

    The timesheet is set up as follows:

    Timesheet Screenshot.png

    In my excel spreadsheet when you choose the project, the customer: job field in the same row turns red, indicating that it is now a required field. If you choose overhead, the explanation field on the same line turns red, indicating who's now is a required field. I want to do the same thing with this form (blushes) is actually make the field required, which is simpler.

    Can someone help me with this? I feel very lost. If it is not possible to change fields based on selections from drop down someone has any alternative suggestions? Any help is very appricated.

    You can do the following...
    Exit the drop-down list with JavaScript as a language event.

    If (DropDown1.rawValue == 'Project') {}
    Customer.Mandatory = 'error ';
    JobField.mandatory = 'error ';
    }

    You can replace the domain names with the actual names in your PDF.

    If you want to enable compulsory you set property "error."

    to disable you set the property to "disabled".

    Thank you

    Srini

  • Adobe Acrobat 9: Javascript populated the drop-down list box - response selected array will not save

    I have a combo on one of my forms box that is filled with the help of a Javascript array.  The drop-down list box is filling very well, but when an item is selected in this drop-down list box, the selected item does not save when the user saves the document.  Any suggestions as to what is the problem and how it can be corrected?  I am a loss to know where even to start the search.  Any help is greatly appreciated.

    Thank you.

    Lisa

    It seems that the drop-down list box may be getting filled with code that runs when the form is opened. If so, it will overwrite the value selected, whenever it opens. The solution would be to change the code so that it is not than that. If not, you can post the form somewhere so we can take a look?

  • define a behavior of scroll 'mobile' for a drop-down list on a desktop application

    Hello

    We are looking for help on a 4.5 AIR Flex application deployed in a tactile desktop environment.

    We are developing some kind of a kiosk application before all designed for desktop computers (mouse). Recently, we tested on a touchscreen used with a stylus or fingers (not a mobile device but a touch screen connected to a computer), all run smoothly without modification the touch events on the screen being interpreted as an interaction of the mouse by the driver.

    So everything works fine, but of course the user interface is not designed to be manipulated with the fingers and especially the scrolling of the list behavior is not suitable: the desktop AIR application displays the vertical scroll bars and buttons to scroll the list up and down, but usually in a touch screen, you scroll the list by dragging (touch something and drag up or to the left element is not selected because that you moved the finger before moving it to the top)

    I know this behavior for a Scroller exists in flex 4.5 in a 'Mobile' project (apparently, it is possible to compile a 'Mobile' project in a desktop AIR app...?)

    So my questions are:

    (1) is it possible to implement this behavior 'mobile' a drop-down list to a desktop AIR application?

    (2) as a general rule, it is possible to set installation (by configuration or almost) 'style' of the application (by 'style' I mean the size and behavior of the components to be handled by a mouse or a finger). It seems possible that the logic behind the component does not change, just the size (if it is a button or the behavior of scroll if it is a list and so on...). Is this something related to skin? or maybe a theme?

    (3) what is the difference between a "desktop AIR application" and a "mobile app" in Flex Builder 4.5? (both project seems to have the same compiler arguments, etc...) ?

    Mich

    In a project Flex desktop, you can activate the scroll key defining interactionMode = 'touch' on the list.

  • LiveCycle: How to select a drop-down list and fill in a text field.

    I have a PDF on Adobe livecycle 8.0 that if selected will auto fill the field area:

    GoalDropDownList: has points:

    People with disabilities

    Functional

    Impairment

    I would like that when disability is chosen this GoalTextField show:

    Patient will return to the previous level of function.

    When functional is chosen GoalTextField to see the

    Patient able to stand 5 minutes

    When the disability is selected GoalTextField to see the

    Patient has full range of motion

    Any help would be appreciated.

    I'm new so can you include in java script where it must go out, enter, etc..

    Thank you all.

    In fact I don't know how to show a picture of this to illustrate what someone knows how?

    Write the code javascript next to the drop-down list in the change event.

    var

    selectedValue = xfa.event.newText;

    If

    (selectedValue is 'Disability')

    TextField1.rawValue

    = "Patient will return to the previous level of function.";

    on the other

    if(SelectedValue=="Functional")

    TextField1.rawValue

    = 'Patient able to stand for 5 minutes.';

    on the other

    TextField1.rawValue

    = 'Patient has full range of motion. "

    Thank you.

  • 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

Maybe you are looking for