Can't get a text field to atuo populate based upon a dropdown selection

I have a drop down box with 3 values that can be selected:
Dropdown2 = 101-3 subd.A
                      101-3 subd.B
                      101-3 subd.C
I am trying to get a text field to auto populate based upon the selection:
if Dropdown2 = 101-3 subd.A then Text4 = "ValueA"
if Dropdown2 = 101-3 subd.B then Text4 = "ValueB"
if Dropdown2 = 101-3 subd.C then Text4 = "ValueC"
I have tried to create a custom calculation script for Text4:
var v= getfiled("Dropdown2").value;
if (v="101-3 subd.A") event.value = "ValueA";
     else if (v="101-3 subd.B") event.value = "ValueB";
     else if (v="101-3 subd.C") event.value = "ValueC";
     else event.value = " ";
I have entered this script and the syntax appears to be correct.(At least to Acrobat XI.  I'm 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 have checked the "commit selected value immediately" in the option of Dropdown2 per some google'ing.  I just can not understand why the values do not appear.  Any help would be appreciated.
Thanks

I made the changes and added the == to my if statements.  When I select a value in Dropdown2, Nothing appears in Text4.  I don't understand.  Is there something else that I need to do beside event.value="Some Value";?
I know it has to be something simple that I am missing, but I just can't seem to see it.
Text4 - Custom Calculation Script:
var v= getfiled("Dropdown2").value;
if (v=="101-3 subd.A") event.value = "ValueA";
     else if (v=="101-3 subd.B") event.value = "ValueB";
     else if (v=="101-3 subd.C") event.value = "ValueC";
     else event.value = " ";

Similar Messages

  • How can I get the "text" field from the actionEvent.getSource() ?

    I have some sample code:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.ArrayList;
    public class JFrameTester{
         public static void main( String[] args ) {
              JFrame f = new JFrame("JFrame");
              f.setSize( 500, 500 );
              ArrayList < JButton > buttonsArr = new ArrayList < JButton > ();
              buttonsArr.add( new JButton( "first" ) );
              buttonsArr.add( new JButton( "second" ) );
              buttonsArr.add( new JButton( "third" ) );
              MyListener myListener = new MyListener();
              ( (JButton) buttonsArr.get( 0 ) ).addActionListener( myListener );
              ( (JButton) buttonsArr.get( 1 ) ).addActionListener( myListener );
              ( (JButton) buttonsArr.get( 2 ) ).addActionListener( myListener );
              JPanel panel = new JPanel();
              panel.add( buttonsArr.get( 0 ) );
              panel.add( buttonsArr.get( 1 ) );
              panel.add( buttonsArr.get( 2 ) );
              f.getContentPane().add( BorderLayout.CENTER, panel );
              f.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              f.setVisible( true );
         public static class MyListener  implements ActionListener{
              public MyListener() {}
              public void actionPerformed( ActionEvent e ) {
                   System.out.println( "hi!! " + e.getSource() );
                   // I need to know a title of the button (which was clicked)...
    }The output of the code is something like this:
    hi! javax.swing.JButton[,140,5,60x25,alignmentX=0.0,alignmentY=0.5,
    border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@1ebcda2d,
    flags=296,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,
    disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,
    right=14],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=true,
    rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=first,defaultCapable=true]
    I need this: "first" (from this part: "text=first" of the output above).
    Does anyone know how can I get the "text" field from the e.getSource() ?

    System.out.println( "hi!! " + ( (JButton) e.getSource() ).getText() );I think the problem is solved..If your need is to know the text of the button, yes.
    In a real-world application, no.
    In a RW application, a typical need is merely to know the "logical role" of the button (i.e., the button that validates the form, regardless of whether its text is "OK" or "Save", "Go",...). Text tends to vary much more than the structure of the UI over time.
    In this case you can get the source's name (+getName()+), which will be the name that you've set to the button at UI construction time. Or you can compare the source for equality with either button ( +if evt.getSource()==okButton) {...}+ ).
    All in all, I think the best solution is: don't use the same ActionListener for more than one action (+i.e.+ don't add the same ActionListener to all your buttons, which leads to a big if-then-else series in your actionPerformed() ).
    Eventually, if you're listening to a single button's actions, whose text change over time (e.g. "pause"/"resume" in a VCR bar), I still think it's a bad idea to rely on the text of the button - instead, this text corresponds to a logical state (resp. playing/paused), it is more maintainable to base your logic on the state - which is more resilient to the evolutions of the UI (e.g. if you happen to use 2 toggle buttons instead of one single play/pause button).

  • Is there a way that you can have two different text fields (email, phone) that one at least one of them must be completed before submitting the form? Can it be done using javascript in the validation tab? if so, how?

    Is there a way that you can have two different text fields (email, phone) that one at least one of them must be completed before submitting the form? Can it be done using javascript in the validation tab? if so, how?

    Here is one solution:
    // mouse up action for submit button;
    function GetField(cName) {
    // get field object for cName field with error checking;
    var oField = this.getField(cName);
    if(oField == null) app.alert("Error accessing field named " + cName + "\nPleae verigy field name, spelling and capitalizeation.", 1, 0);
    return oField;
    } // end GetField function;
    var oPhone = GetField("phone");
    oPhone.required = oPhone.value == oPhone.defaultValue;
    var oEmail = GetField("email");
    oEmail.required = oEmail.value == oEmail.defaultValue;
    if(oPhone.required && oEmail.required) {
    app.alert("Missing required fields.", 1, 0);
    } else {
    app.alert("Submitting form", 3, 0);
    // additional code for submission;

  • I recently bought a new macbook pro and set it up using the migration assistant and my mac mini.  I can't get the text message forwarding feature to work with both computers.

    I recently bought a new macbook pro and set it up using the migration assistant from my mac mini.  I can't get the text message forwarding feature to work with both computers.  It keeps saying that I only have 2 devices setup, my iPad and my macbook pro.  When I mess with the setting on my mac mini, it goes from saying that that is one of the devices to my macbook pro being the 2nd device.  I think that something happened as a result of my using the migration assistant and now it thinks that my macbook pro and my mac mini are one and the same computer.  Any ideas?

    Thanks, Sig.
    The old computer is a 2.6 Ghz Intel Core 2 Duo
    The new one is a 2.3 GHz intel core i7
    In going over this, thanks to "tallking it out" with you, I did discover the Text Edit problem.  Because I've still been unable to get the new computer text size (fonts or whatever) to match the old computer, I did not notice that the curser is now different--the line midway down the curser has to be placed on the line I am working upon, otherwise the edits go elsewhere on the page.  Now, with a bit of difficulty, I am able to get Text Edit to work correctly.
    If you have any ideas as to why my menu bar and Text Edit type are still so slow, I'd love to have them. 
    (I went through the process you suggested earlier, re my Trackpad preferences, and found no improvement.)

  • How can I program the text fields in my email forum to have rounded corners

    How can I program the text fields in my email forum to have rounded off edges or corners. 
    this is the code im using.
    // insert code here// insert code here// prepare email field
    var email = sym.$("email")
    email.html("Enter your Email: ");
    inputEmail = $('<input />').attr({'type':'text', 'value':'', 'id':'email'});
    inputEmail .css ('font-size', 14);
    inputEmail .css ('width', 350);
    inputEmail .css ('background-color', '#4e4e4e');
    inputEmail .appendTo(email);
    // prepare topic field
    var topic = sym.$("topic");
    topic.html("Topic: ");
    inputTopic = $('<input />').attr({'type':'text', 'value':'', 'id':'topic'});
    inputTopic .css ('font-size', 14);
    inputTopic .css ('width', 350);
    inputTopic .css ('background-color', '#4e4e4e');
    inputTopic .appendTo(topic);
    // prepare message field
    var message = sym.$("message");
    message.html("Message: ");
    inputMessage = $('<textarea />').attr({'type':'textarea','rows':'10', 'cols': '25','value':'', 'id':'message'});
    inputMessage .css ('font-family',"Arial,Helvtica,sans-serif");
    inputMessage .css ('color',"#ffffff");
    inputMessage .css ('font-size', 14);
    inputMessage .css ('background-color', '#4e4e4e');
    inputMessage .css ('box-shadow', '#4e4e4e');
    inputMessage .css ('width', 350);
    inputMessage .css ('height', 150);
    inputMessage .appendTo(message);
    var submitBtn = sym.$("btn");
    submitBtn.html("Submit");
    submitBtn.css("text-align", "center");
    submitBtn.css("font-size",14);
    submitBtn.css("font-weight","bold");
    submitBtn.css("color","#ffffff");

    Try this: inputEmail.css ('border-radius', '25px');
    attachment
    more details

  • How to get the text field in the header for only first page of the report

    Hi,
    I am developing reports in BI Publisher Enterprise where i am facing problem i.e., i have to get some text field in header,for only first page in the result but it is displaying in all the other pages of the report in result.So,please if you have any idea of how to solve it, please reply.It is required as early as possible.
    Thanks in Advance

    Invalid path? What are you doing? Writing the report output to an invalid directory?
    Where are your terms and conditions? It would be very easy just to put them in a database table and select them in your report query.

  • How can I get my texts back after IOS update?

    How can I get my texts back after an IOS update?

    Hi Clembo60,
    Welcome to the Apple Support Communities!
    I understand that your text messages are missing after an update on your iPhone. If you have a backup of your device on either iTunes or iCloud, you can restore from that backup and bring your information back. Please review the attached article, which covers how to back up and restore from backups, for more information. 
    Back up and restore your iPhone, iPad, or iPod touch using iCloud or iTunes - Apple Support
    Best regards,
    Joe

  • How to get readonly text field value in backing bean?

    Below is my code in JSF.
    <h:inputText id="prodLine" value="#{fbackingBean.value}" required="true" styleClass="readOnlyField" readonly="true"/>
    This is a readonly field, and the value will been pass in by a pop up window. after the value had been passed in, i try to store the data which i had selected, but the value in readonly field (which show in above) return a null value.
    May i noe how can i get the readonly field value in backing bean? thanks!

    Why not keep track of the value in the backing bean? If it's a read only value set from a backing bean it should be simple to retrieve from a backing bean.
    I'm new to JSF, but one thing that I have figured out is to try to put everything in the backing beans possible and to do as little as possible within the JFS web page components.

  • I have Windows 7 and PS Elements 10 and can't get the text button to work properly.  What can I do?

    I have Windows 7 and PS Elements 10 and can't get the text button to work properly.  What can I do?

    Try selecting the T tool and then doing a reset (see image below)

  • Can i get a text tone on my 4th generation?

    can i get a text tone for my 4th generation ipod?

    Thanks Shane!
    I saw your notes in Creative Cow and intend to follow Log and Transfer system until I saw your note.
    XDCAM Transfer Utility to XDCAM QT? Is this a better alternative u think?
    Best Wishes from Asia
    Noel

  • Yoga 13 MSIE10 can't type into text fields

    New machine Feb 2013 used exclusively in laptop mode. Has been great overall but right out of the box I could not type text into any form fields using Internet Explorer 10. What an intro to Windows 8! Discovered I can type text in notepad, then copy and paste it into fields but cannot enter it directly. This was happening with the factory installed software so if it's a third party app conflict it's one that's original equipment. Thankfully Chrome works fine, but sometimes I need to use MSIE and am quickly reminded why I can't.
    Google and Lenovo forums are mum on this subject. Some suggestions pointed to SFC /scannow, which came up with a litany of things it couldn't fix. Enhanced protected mode in MSIE also did not help. Didn't appear possible to reinstall MSIE (where's the DOJ when you need them?) What's next?  Thank you all for your assistance.

    hi dserdu,
    Welcome to the Forums.
    Are you having this issue on the desktop version of I.E. or the Metro version?
      - if the issue only happens on the metro IE, try to open the Desktop I.E. > press ALT+T > choose Internet options. On the Internet Options, go to the Programs Tab, set I.E. to Always and check the box "Open Internet Explorer tiles on the desktop"
    - Link to picture
    Alternatively, if the issue is compatibility between the website and the I.E. versions, you can run I.E. 10 in compatibility mode or on a lower version (i.e. I.E. 9, I.E. 8., ...etc.). To do this:
    1. Open the Desktop I.E. and press F12
    2. On the developer tools, choose Browser Mode IE 10 and choose an I.E. version (i.e. IE 9)
     - Link to picture
    3. When dnoe, press F12 again and observe if you can now type into text fields.
    Let me know your findings
    Regards
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"! This will help the rest of the Community with similar issues identify the verified solution and benefit from it.
    Follow @LenovoForums on Twitter!

  • I can't get the text tool to work

    I can't get the text tool to work in After Effects CC, what am I doing wrong, have I pressed the wrong key?

    We need a lot more information to help you. Tell us exactly what you're doing and exactly what the results are. Screenshots are useful.
    In general, when answering questions on this forum, provide answers to the questions here: http://forums.adobe.com/thread/961743

  • Hello, I can not use my text field in PS cc. I can drag a text box, but when I write something in, I can't see the letters!

    Hello, I can not use my text field in PS cc. I can drag a text box, but when I write something in, I can't see the letters!

    Opacity at 100?
    Does the cursor move as you type?
    Reset the tool by right clicking here to see if that is the remedy.

  • My phone was stolen - can I get my text messages back?

    my phone was stolen - can I get my text messages back?

    Not unless you backed up the phone before it was stolen.

  • Can you scroll multiple text fields with 1 UIscrollbar component?

    I have been poking around on the internet trying to find out a way to do this on flash using AS2.0 but have had no luck. Is it even possible?!
    or is there another way of achieving a similar affect?
    I have XML data being pulled from an array of attributes that get listed in there own text field or column basically.
    Attribute1(text1)
    Attribute2(text2)
    Attribute3(text3)
    item1
    item2
    item3
    item4
    location1
    location2
    location3
    location4
    date1
    date2
    date3
    date4
    Above is how the data gets displayed in the 3 different text boxes... each item is associated to a location and a date and i need to be able to scroll down through the items but have the locations and dates stay inline with the specific item.
    Any suggestions would be great!
    Thanks in advance.

    i don't have a clue about the XML (I'm still in embryo stage on that one at one-half a tutorial) BUT,
    to connect without commas, you can do something like this. My array name was aHiragana (japanese letters)
    var sHiragana:String = aHiragana.join(""); //kills the comma
    words.text = sHiragana.toString(); //works, note "s" not "a" infront of Hiragana.
    no idea if this is compatible with XML.

Maybe you are looking for

  • No Results after build a Parent-Child Hierarchy in OBIEE11G

    Hi All: Here's an problem. I followed the "http://sandybi.wordpress.com/2010/08/17/hierarchies-in-obiee-11g-part-1/" this article step by step to create a parent-child hierarchy in admin tool in OBIEE11G. But after check in and try to retrieve the hi

  • How can I sort audio by tracks within each album?

    I am trying to use an ipod to listen to a series of lectures. The lectures are organized in a specific sequence of tracks. This is similar to songs in an album except that I need to listen to them in a specified order. Listening to the lectures in a

  • ESS/MSS in multiclient szenario

    Hello, we want to use on one portal two ESS/MSS (Erp2005) szenarios pointing to different backend clients. What we did so far: 1. Copy the Business Portal in portal to a second folder 2. Redirect the JCo Connections of copied iViews to new client 3.

  • Internal temperature monitoring utility?

    Is there any monitoring software (similar to Activity Monitor) that detects whether key components such as the CPU and hard-drive are running at a reasonable temperature or are overheating? I believe that temperature-monitoring sensors are present in

  • Abstract methods in ByteBuffer class

    I'am a little confused with abstract methods get() and put() in ByteBuffer class. Java API says: public abstract class ByteBuffer extends Buffer implements Comparable // This is a partial API listing public abstract byte get( ); public abstract byte