SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Jun 2004
    Location
    Montreal
    Posts
    275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Dropdown onchange problem

    Hi,

    i've got a problem and I can figure out what it is... maybe i'm too tired!

    here's my javascript function:
    Code:
    function fnSelect(from,into){
    
    //Variable Data
    var drop = document.getElementById(from);
    var item = document.getElementById(into);
    
    //Output Selected
    item.value = drop.options[drop.selectedIndex].text;
    
    }
    here's my html dropdown:
    Code:
    <select id="drop" name="f_list" size="10" onchange="fnSelect('drop','item');">
    <option value="1">Label 1</option>
    <option value="2">Label 2</option>
    <option value="3">Label 3</option>
    </select><br />
    <input id="item" type="text" name="f_item" value="" class="mt10" />
    Can anyone help me ?

  2. #2
    SitePoint Enthusiast
    Join Date
    Mar 2006
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This seems to work as I would expect (tested in IE6 and FF1.5).

    What problems are experiencing exactly?

    NickJ


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •