Dilemma of the combo box ~ $$$

Adobe scripting,

Looking for a script I can add the drop-down list box properties > Actions > execute a JavaScript script on 3 different areas of the drop-down list.

Basically, I need the following code creates.

If item1 option selected Combobox1 textfield1 = 123456

textfield2 = 987654

textfield3 = 523452

If option selected item2 textfield1 Combobox1 = abcde

textfield2 = qwerty

textfield3 = asdfg

If item1 option selected Combobox2 textfield4 = 123456

textfield5 = 987654

textfield6 = 523452

If option selected item2 textfield4 Combobox2 = abcde

textfield5 = qwerty

textfield6 = asdfg

If item1 option selected Combobox3 textfield4 = 1q1w2e3

textfield5 = w2e3r4t5

textfield6 = q1w2e3r4

If Combobox3 option textfield4 selected item2 = p09i8u7

textfield5 = p0o9i8u7

textfield6 = p0o9i8u7

I just need a script that I could use each of "drop-down list box properties > Actions > execute a JavaScript script.

Concerning

Steve.

Yes, you will need to add additional code to generalize the function to be used with any combobox control.  The problem is that each combobox affects different areas and has another source for data that are placed in these areas.  It's a matter of abstraction, the code needs to extract the names of the concerned fields and data that are placed in these areas.

To do this is to create a data table (object) for each combobox that includes the names of the fields and the data that are used for these fields. Then, this object is passed to the function 'SetFields' for each combobox.  If the change on the ComboBox event would include code that looks like this:

SetFields (oCombo1Data);

The best way to deal with different domain names is to use the same name for the form field that is defined and the data field that he is placed in.  For example, in the article, the sample data looks like this.

var DeptData = { Accounting:{  contact: "Steala Damuni",
                               email: "[email protected]",
                               deptnum: "cmp1234" },
                 Engineering:{ contact: "Frank N. Stien",
                               email: "[email protected]",
                               deptnum: "eng1234" },
                 Marketing :{  contact: "Shelly Oughtbuks",
                               email: "[email protected]",
                               deptnum: "mkt1234" },
                 ITSupport:{   contact: "Goah  Wei",
                               email: "[email protected]",
                               deptnum: "its1234" }};

Where each entry in the drop-down list returns an object with 3 elements, 'contact', 'email' and 'Department '.  If fields have the same name, the code can if write to simple use the name of the entries like domain names.  Like this:

SetFields (oDataObject) function

{

var oValues = [event.value] oDataObject;

(var Clfd in oValues)

this.getField (Clfd) .value = oValues [Clfd];

}

Now, everything is controlled from the data object that is used for the ComboBox and SetFields function can be used with any control, as long as there is no corresponding data object.

Thom Parker
The source for PDF Scripting Info
pdfscripting.com

The Acrobat JavaScript Reference, use it early and often
http://www.Adobe.com/devnet/Acrobat/JavaScript.html

Then more important JavaScript development tool in Acrobat
The Console window (video tutorial)
The Console Window (article)

Tags: Acrobat

Similar Questions

  • Add items to the combo box when running

    In my program, I want to add int '34' "43", "17"... and let the user choose one of them to the drop-down list box. How can I add items to the combo box when running. Create a property node 'String [] '? I try that, but its screen is "3443". I want to display as "34".

    43

    17

    See attached extract

  • Hide / remove / bypass solution the arrow in the combo box

    Here's a thing. I need to eradicate the combo box arrow. We produce a feedback form with multiple options for your comments, once the guardian chose the relevant feedback they want the arrow to not be visible to the student. Essentially so that the viewer of the end of the PDF can not say there is a combo box with the arrow, see arrow. Looking around I found that you can not hide the arrow to the right of the combo box.

    A possible solution is to design a black bar in the form that may hide the black arrows (unless they become white). However, I prefer the code solutions more own which are not dependent on a static Visual design. I wonder is there away to hide the drop-down list together box and passing of the list item selected in a text field?

    FYI a list box is not suitable that the color blue/gray selection is then visible.

    Charlie

    When you create a read-only combo box, the arrow is not displayed. This is probably what you want to do anyway before distributing the documents to the end user. You can automate the process of creating fields read-only. Here's a script how it for a single field:

    getField("combo1").readonly = true;
    

    An option even better perhaps to flatten pages, which converts the apparitions of field content page regularly. The arrow does not appear for the drop-down list boxes, and it no longer fields of interactive form for the end user to mess with. You can use the following JavaScript code to do this:

    flattenPages();
    

    or use optimization PDF or preflight to do the same. Or use this nifty script: http://www.uvsar.com/projects/acrobat/flattener/

  • Event of the combo box change problem

    Hi all

    I add a drop-down list box in actionscript dynamically. And addition of change for this event.

    combo: more var = new ComboBox;

    combo.addEventListener (Event.CHANGE, changeHandler);

    countryCmb.selectedIndex = 1;

    If I put the index selected dynamically using threshold, the change event is not firing. I mean that it does not call the changeHandler method.

    I do something wrong to it.

    Can anyone help me regarding this.

    Thanks in advance

    Rambeau.

    Hello

    U can give please the full code.

    Where is the data provider for the drop-down list box?

  • Is the combo box drop-down "Targets" in LabVIEW 2010?

    Guy of OR,.

    In LabVIEW 2010, I installed the touch screen module but 'Touch Panel corresponding project' does not appear in the list of "Targets" of the "Getting Started" initial LV window. The Add/Remove dialog box confirms that the module is installed... Is - can be changed?

    Thanks in advance

    I think that the Touch Panel project should be added to the drop target when you install the Touch Panel Module.  As this isn't the case, I think it's a bug.  Thanks for pointing out that, and I will file a request for corrective measures to get changed for the next editions of LabVIEW.

    Kind regards

    Elizabeth K.

    National Instruments | Sales engineer | www.NI.com/support

  • Fill the combo box list dynamically

    I have a drop-down list box that is filled from a cluster table which is unbundled element with that I want to fill the drop-down list box. There are several types with the same element such as

    1-60mm

    1-60mm

    1-60mm

    1-60mm

    3-60mm

    3-60mm

    What I want to do is just see one 1-60mm and a 3-60 mm and when selected will get the value of the index view with thos types only in a table?


  • ToolTip for the drop-down list of the combo box

    Hello

    How can I give a ToolTip when I ride on an item in the drop-down list of a ComboBox?
    Its a little urgent: () help, please.

    Thanks in advance,
    Yann

    HI HI...

    Try to play with this example changed from Flex 2 help...

    Import mx.events.ToolTipEvent;

    [Bindable]
    public var cards: Array = [{label: 'Visa', data: 1},]
    [{label: "MasterCard", data: 2}, {label: "American Express", data: 3}];

    [Bindable]
    public var selectedItem:Object;

    ]]>







  • Someone advise me on how to record and remember the actual information from a group of combo boxes?

    I have a set of combo boxes save a devices status information. I would like to record and remind all selections. I know there are properties to access the selected items, but the research on, I do not know the technique to do so. I want to save/recall in XML format. I made an attempt, and he saved the combo box data, but not the selections. Thanks for any help.


  • Additional mouse click required to set other combo box values based on the current selection combo box

    I have an Acrobat PDF form where there are 8 combo boxes (not editable) which are related in a logical way, but have unique names and a list of unique values, with the exception of a default value that represents 'null' or 'none '.

    for example:

    The first 1 combo box value is "none" followed by the value A1, B1, C1, etc., and Combo box 2 the first value is 'none' followed of the values A2, B2, C2, etc...

    The combined list useful values for every combo boxes relate to the types of unique product for the user to select mode 'radio button '.

    When the user selects one of the 8 Combo boxes and performs one selection other than 'none', then the form must verify the 7 other combo boxes and when any current value is not equal to 'none', he has to change 'None '.

    The following script is currently enrolled in the properties of "Actions - Mouse Run - Up a Javascript" from one of the drop-down list boxes, others have similar scripts as well.

    (var cbox is the current combo box and var obox is for other drop-down list boxes when called).

    Cbox var = this.getField ("TagStyleStake");

    If (cbox.value! = "none")

    {

    obox var = this.getField ("TagStyleBasket");

    If (obox.value! = "none")

    {obox.value = 'none' ;}

    Obox = this.getField("TagStylePushon");

    If (obox.value! = "none")

    {obox.value = 'none' ;}

    Obox = this.getField("TagStyleHandle");

    If (obox.value! = "none")

    {obox.value = 'none' ;}

    Obox = this.getField("TagStyleHang");

    If (obox.value! = "none")

    {obox.value = 'none' ;}

    Obox = this.getField("TagStyleBlank");

    If (obox.value! = "none")

    {obox.value = 'none' ;}

    Obox = this.getField("TagStyleMolded");

    If (obox.value! = "none")

    {obox.value = 'none' ;}

    Obox = this.getField("TagStyleSignage");

    If (obox.value! = "none")

    {obox.value = 'none' ;}

    }

    The current problem is that, when a Combo is selected and one option other than the 'none' value is clicked, the other combo boxes do not include the 'None' value.

    To reset the other combo boxes requires another click on the option which has just been moved to the position selected in the drop-down list, but it seems reasonable that the drop-down list boxes should reset with the initial click the option in the drop-down list.

    I tried other properties (Format, validate, Calculate) but without success.

    What I'm missing here?

    The normal way to proceed is to define "value option selected to validate immediately" and to place the code in the event of the combo box button. And instead of the first two lines you have, you need to use something like:

    If (! event.willCommit & event.changeEx! == 'none') {}

    Your other code goes here

    }

    The changeEx property returns the value of exports, if any, for the selected item.

  • Combo box not open links in the browser

    Hello

    I use the Combo box component.

    I gave to the drop-down list box the instance name Mazonedelistederoulante

    I added a few tags and web address

    Here is my code:

    myComboBox.addEventListener (Event.CHANGE, newAddress);

    function newAddress (evt) {}
    var myURL = new URLRequest (myComboBox.selectedItem.data);
    navigateToURL (myURL);


    }

    Publish the movie with HTML, while it resides in a HTML file, but I get the following message.

    Flash Player warning.png

    No one knows what causes this and how to stop it from coming so that the drop-down list box works and takes you to the web page?

    Thank you

    Babs

    It is a breach of security as your 'local' swf attempts to talk to the internet. Put your swf in a page and then host this page. You should see the error disappears.

    For local testing, tap the 'Settings' tab, locate your file and give it permission. See this section of the settings page for info:

    http://www.Macromedia.com/support/documentation/en/flashplayer/help/settings_manager.html# 117164

  • The selected text combo box.

    Hey people,

    I have this strange thing that happens with a drop-down list box. I use a loop to fill a table. The table is the data provider for a combo box. Everything works well except the first vaule of the table does not appear in the combo box as long as the selected value. I tried to adjust the index selected-1, 0, 1, but he never displays as soon as the page loads.

    <? XML version = "1.0" encoding = "utf-8"? >
    " < = xmlns:mx mx:Application ' http://www.Adobe.com/2006/MXML layout "'absolute' = initialize ="buildcombo (); » >

    < mx:Script >
    <! [CDATA]
    [Bindable] public var MyOptions:Array = new Array();

    private function buildcombo (): void
    {

    MyOptions.push ({}
    label: "- SELECT -", data: 0
    });

    for (var i: int = 1; i < 10; i ++)
    {
    MyOptions.push ({}
    label: 'OPTION' + i, data: I.ToString
    });
    }

    }

    private void reset (): void
    {
    MyOptions = new Array();
    buildcombo();
    }

    private void ShowValue (): void
    {
    trace (MyCombo.value);
    }

    []] >
    < / mx:Script >
    < mx:ComboBox id = "MyCombo" x = "325" y = "145" dataProvider = "{MyOptions}" change = "ShowValue (); "/ >
    < mx:Button = "362" x = "224" label = "Reset" click = "reset (); "/ >
    < / mx:Application >

    
    
    
         
            
        
        
        
    
    
  • Issue of change event in the dialog box.

    Hi all

    I'm having a problem with a user dialog box. The dialog box should use eventchange to update aspects of the dialog box based on a user selection in a drop-down list box. The problem I encounter is that eventchange does not recognize the change of no selection to the first selection. IE, a user will have to select something else first, then change to what they want to be recognized. Is there something better that would solve this problem? or is the problem something else entirely?

    Thank you

    Artemis

    Hey, Artemis,

    The simplest solution would be to use the event EventInitialize to set the combo box to a default value when the dialog box opens, and your settings dialog box to match the selection.  In this way the first change makes the user would trigger change of value.

  • How do I change the list box within a cluster

    I have a cluster with multiple controls in it. One of them is a combo box on which I need to occasionally change the items to the breast. If the drop-down list box out of the bunch, I could easily access 'Strings []' property of the combo box. However, when inside of the bunch, I don't seem to not be able to get this property. In the excerpt below, the drop-down list box is the control at index 1. I get out of the reference to this control, connect it to a 'property node' and the 'Strings []' property is not found.

    Does anyone know how to fix this?

    Hello

    Take this simple way, create a node prperty for the cluster that you have, right-click on the prperty node and select link to, browse lists void until the drop-down list box. See attachment.

  • How can I update by program table combo box control type def?

    I use LV 8.6.1 and I am trying to create a table control panel object in which the user can select an item to list box for each element of the array.  I also have to periodically update the list of values.  Currently, I have configured the drop-down list box (selection of Automation sequence - see attached) as a type non-stricte def so I can write news channels to the list values when I need to.  But I can't seem to find a way to get the table (list of batches - see rasthaus) fill the new value drop-down list box.

    Automation box refelcts the new string sequence selection that I add programmatically, but the combo boxes in the batch list table control do not have the new channel.

    Anyone have any ideas?

    I have attached the screenshot of the drop-down list and table controls.

    Thank you

    Dan

    I considered that mention strings and values have a property that cannot be stored in a typedef, but when I tried it out, it seemed that it was.  So I just did not comment on that.  Maybe the strings and values may be among the typedef, maybe not.  The values of the controls certainly cannot.  Strings and values can be in kind of a gray area.  But you can certainly expect changes to a control to automatically update another control, because they are typedefs.  You cannot change the typedefs during execution.

    Let's put another example that has nothing to do with the values.  You have a regular typedef of a digital.  It is saved with the text in red in scientific notation.  You place two instances of this on your drawing.  You can programmatically change each other colors or other digital formats.  A change does not affect the other.  If it's a strict typedef, you would be locked in the way in which it was saved and could not change it programmatically.

    Take a look at this.  If you cannot programmatically, to update your channel list and values for a single combobox (a scalar string) you will be able to put up-to-date for when the combobox control is the data type for a table.  Simply get a reference to the element of the array.  It does not use typedefs anyway.

  • Channels not defined in Combo Box Bug?

    I found a problem with the drop-down list box control:

    1. create a drop-down list box and deselect 'allow Undefined Strings.

    2. run the VI

    3. Select a list box item

    4. press on the BACKSPACE key to remove a few letters of the item

    5. click on on the front panel

    The combo box is filled with a string not set!

    Disabling the BACKSPACE key is not a valid work-around because the user may need this while typing the value.  Expected behavior of the control would be to restore the previous value.  Any comments?

    Yes.

    Take a look at the bug report in this thread.

    http://forums.NI.com/NI/board/message?board.ID=170&thread.ID=379475

Maybe you are looking for