Selection of a value changes text in text box? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Selection of a value changes text in text box?

[b][red]This message was edited by cmps_getch at 2006-9-1 12:14:24[/red][/b][hr]



Comments

  • zibadianzibadian Posts: 6,349Member
    : I feel dumb asking this because its prob simple but.... How do I make it where say I had three options in a drop down menu and the user selects one i want the textbox on the side of the dropdown to change its value depending on what the user selected automaticly without refreshing the page? any ideas???
    :
    I've used the following code for a combobox with a textbox:
    [code]
    function setScript()
    {
    txt=document.forms[0].f2.options[document.forms[0].f2.selectedIndex].text;
    document.forms[0].f1.value=txt;
    }
    [/code]
    YOu can use a similar code for a dropdown menu.
  • cmps_getchcmps_getch Posts: 102Member
    nope didnt work

    all i want to do is change the values of the text box depending on the selction from the drop menu







    UNITS ON HAND
    80
    100
    125
    135
    135









  • zibadianzibadian Posts: 6,349Member
    [b][red]This message was edited by zibadian at 2006-9-1 13:33:47[/red][/b][hr]
    : nope didnt work
    :
    : all i want to do is change the values of the text box depending on the selction from the drop menu
    :
    :
    :
    :
    :
    :
    :
    : UNITS ON HAND
    : 80
    : 100
    : 125
    : 135
    : 135
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    This example might help: http://www.w3schools.com/htmldom/coll_select_options.asp
    Especially take a look at the Try-it-yourself demos.
Sign In or Register to comment.