Combo Box and text box

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mike

    Combo Box and text box

    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("comb obox")

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


    What I am doing wrong?



  • Mike

    #2
    Re: Combo Box and text box

    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" <lrn@hotpop.com > wrote in message
    news:ad8u5nb8.f sf@hotpop.com.. .[color=blue]
    > "Mike" <hhey2@lycos.co m> writes:
    >[color=green]
    > > I have a combo box and a text box.[/color]
    >
    > 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?
    >[color=green]
    > > Text to be display will be contigent upon what is selected via the
    > > combo box. How do I do this?[/color]
    >
    > Displayed how?
    >[color=green]
    > > I put the following code in the text box object:[/color]
    >
    > How do you put it into the text object? As an event handler?
    > As text?
    >[color=green]
    > > var a = get thisField("comb obox")[/color]
    >
    > 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.eleme nts['combobox'].selectedIndex + 1;
    >
    > (the "+ 1" is to match your tests, since the selection index starts
    > at zero.
    >[color=green]
    > > If (a==1)[/color]
    >
    > The keyword "id" is lower case and Javascript is case senesitive.
    >[color=green]
    > > {
    > > event.value = "Test1"[/color]
    >
    > 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.
    >[color=green]
    > > What I am doing wrong?[/color]
    >
    > Not giving us enough information :).
    >
    > /L
    > --
    > Lasse Reichstein Nielsen - lrn@hotpop.com
    > Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
    > 'Faith without judgement merely degrades the spirit divine.'[/color]


    Comment

    Working...