Results 1 to 3 of 3

Thread: Selection and display problem

  1. #1
    Join Date
    Mar 2011
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Selection and display problem

    I have problem ,the code cannot operate. I would like your opinion.The user must select in dropdown list having one display of image every time.Thanks

    js code
    Code:
    var sel = document.getElementById("sw");
    function f1(){
       var imgs = ['chart1.cgi', 'chart2.cgi', 'chart3.cgi', 'chart4.cgi'];
       var im = document.getElementById("pic");
       im.src = imgs[this.selectedIndex]; 
    }
    html code
    Code:
    <img id="pic" src="chart1.cgi" />
    
    <select name="sw" id="sw" onchange = "f1()" >
       <option value="s1">what</option>
       <option value="s2">whatever 2</option>
       <option value="s3">whatever 3</option>
       <option value="s4">whatever 4</option>
    </select>

  2. #2
    Join Date
    Jul 2009
    Location
    Binus University
    Posts
    472
    Thanks
    78
    Thanked 21 Times in 21 Posts

    Default

    any link we can see, cause there's a lot of dropdown script out there. Which one did you use.
    _____________________

    David Demetrius // davejob
    _____________________

  3. #3
    Join Date
    Mar 2011
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Hello, link about what.In dropdown list s1 ,s2,s3,s4 must selected in order to display any of 4 chart.cgi.Thanks

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
  •