SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Addict
    Join Date
    Aug 2006
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    a.options[a.selectedIndex].disabled = true ;

    The following code is not working on Internet Explorer 6.0. What can I do? Thanks...
    Aşağıdaki kod, İnternet Explorer 6.0'da çalışmıyor. Ne yapabilirim? Teşekkürler...
    Code:
     
    <script type="text/javascript">
    
    var i = 0 ;
    
    function addOption (a) {
    
    var s = document.getElementById('select4');
    
    if(a.selectedIndex >0) {
    s.options[i]= new Option(a.options[a.selectedIndex].value,a.options[a.selectedIndex].text) 
    
    a.options[a.selectedIndex].disabled = true ; 
    i++ ;
    }
    }
    
    </script>
    
    <select onchange="addOption(this)">
    <option value="">choose</option>
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
    </select>
    
    <select onchange="addOption(this)" >
    <option value="">choose</option>
    <option value="10">10</option>
    <option value="20">20</option>
    <option value="30">30</option>
    <option value="40">40</option>
    </select>
    
    <select onchange="addOption(this)" >
    <option value="">choose</option>
    <option value="100">100</option>
    <option value="200">200</option>
    <option value="300">300</option>
    <option value="400">400</option>
    </select>
    
    <select id="select4">
    
    </select>
    Last edited by muazzez; Apr 12, 2007 at 11:58.

  2. #2
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That is because IE (same with version 7, same crap) does not support the disabled attribute on options...


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
  •