Combo Box and text box

Discussion in 'Javascript' started by Mike, Sep 24, 2003.

  1. Mike

    Mike Guest

    I have a combo box and a text box. Text to be display will be contigent
    upon what is selected via the combo box. How do I do this?

    I put the following code in the text box object:

    var a = get thisField("combobox")

    If (a==1)
    {
    event.value = "Test1"
    }
    if (a==2)
    {
    event.value = "Test2"
    }


    What I am doing wrong?
     
    Mike, Sep 24, 2003
    #1
    1. Advertising

  2. "Mike" <> writes:

    > I have a combo box and a text box.


    Browsers don't have combo boxes. Is it a select element and an input
    element? Or is it not a browser you are talking about?

    > Text to be display will be contigent upon what is selected via the
    > combo box. How do I do this?


    Displayed how?

    > I put the following code in the text box object:


    How do you put it into the text object? As an event handler?
    As text?

    > var a = get thisField("combobox")


    This is no language I know of. I assume you want to know what is
    selected in the select element. That would *probably* be something
    like the following (but I can't know for sure without seeing the
    code):

    var a = this.form.elements['combobox'].selectedIndex + 1;

    (the "+ 1" is to match your tests, since the selection index starts
    at zero.

    > If (a==1)


    The keyword "id" is lower case and Javascript is case senesitive.

    > {
    > event.value = "Test1"


    What is this event that you try to assign a property to? It *probably*
    refers to the event object of the event that triggered the event handler
    this code is in (but I am guessing here). Event objects don't have a value
    property normally, so I guess you will be extracting the value later
    for display.

    > What I am doing wrong?


    Not giving us enough information :).

    /L
    --
    Lasse Reichstein Nielsen -
    Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
    'Faith without judgement merely degrades the spirit divine.'
     
    Lasse Reichstein Nielsen, Sep 24, 2003
    #2
    1. Advertising

  3. Mike

    Mike Guest

    I have two objects on my PDF Form (using Acrobat 4.0):

    Combo Box named Contract
    Text Box named Contract Name

    After the user selects the Contract in the combo box, I want the Contract
    Name to appear in the text box. For example: The user selects 22335 from
    the combo box, Contract Name for 22335 will appear in the text box.

    I put the below code in the Text Box object.

    Does this clarify a little bit?

    "Lasse Reichstein Nielsen" <> wrote in message
    news:...
    > "Mike" <> writes:
    >
    > > I have a combo box and a text box.

    >
    > Browsers don't have combo boxes. Is it a select element and an input
    > element? Or is it not a browser you are talking about?
    >
    > > Text to be display will be contigent upon what is selected via the
    > > combo box. How do I do this?

    >
    > Displayed how?
    >
    > > I put the following code in the text box object:

    >
    > How do you put it into the text object? As an event handler?
    > As text?
    >
    > > var a = get thisField("combobox")

    >
    > This is no language I know of. I assume you want to know what is
    > selected in the select element. That would *probably* be something
    > like the following (but I can't know for sure without seeing the
    > code):
    >
    > var a = this.form.elements['combobox'].selectedIndex + 1;
    >
    > (the "+ 1" is to match your tests, since the selection index starts
    > at zero.
    >
    > > If (a==1)

    >
    > The keyword "id" is lower case and Javascript is case senesitive.
    >
    > > {
    > > event.value = "Test1"

    >
    > What is this event that you try to assign a property to? It *probably*
    > refers to the event object of the event that triggered the event handler
    > this code is in (but I am guessing here). Event objects don't have a value
    > property normally, so I guess you will be extracting the value later
    > for display.
    >
    > > What I am doing wrong?

    >
    > Not giving us enough information :).
    >
    > /L
    > --
    > Lasse Reichstein Nielsen -
    > Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
    > 'Faith without judgement merely degrades the spirit divine.'
     
    Mike, Sep 24, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QW5nZWw=?=

    COMBO BOX INSTEAD OF DROP DOWN BOX

    =?Utf-8?B?QW5nZWw=?=, Jun 29, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    616
    Ken Cox [Microsoft MVP]
    Jun 29, 2004
  2. Adrian
    Replies:
    1
    Views:
    227
    Bullschmidt
    Feb 18, 2004
  3. dthmtlgod

    Fill Combo Box based on another Combo Box

    dthmtlgod, Nov 16, 2005, in forum: ASP General
    Replies:
    1
    Views:
    595
    Bob Barrows [MVP]
    Nov 16, 2005
  4. Mike

    combo box with Text box

    Mike, Sep 24, 2003, in forum: Javascript
    Replies:
    0
    Views:
    96
  5. SM
    Replies:
    2
    Views:
    373
Loading...

Share This Page