Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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













  • 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
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    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.