Displaying Value

Discussion in 'HTML & Website Design' started by aiden857, May 20, 2007.

  1. #1
    Hi all how do you display the value of a drop down list in a text field.

    Example :
    <select name="destin" id="destin" onchange="getPrice();">
    <option value="Dublin 1">Abbey St</option>
    <option value="Dublin 2">Amiens St</option>
    <option value="Dublin 3">Capel St</option>
    </select>

    I need to display the area code "dublin 1, 2, or 3" in a readonly textfield.

    Thanks and Top of the morning to ya. I wonder do people actually think the Irish say that.
     
    aiden857, May 20, 2007 IP
  2. -bank-

    -bank- Well-Known Member

    Messages:
    674
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    120
    #2
    hmm, sorry I can't help you although would be interested to know.
     
    -bank-, May 20, 2007 IP
  3. aiden857

    aiden857 Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    In the end this is the code i got to work

    var el = document.getElementById('destin');
    var inp = document.getElementById('input12');
    inp.value = el.options[el.selectedIndex].value ;
     
    aiden857, May 20, 2007 IP