SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Guru adammc's Avatar
    Join Date
    Aug 2004
    Location
    Cairns, Australia
    Posts
    762
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Help with dropdown jump list in IE

    Hi guys,

    I am using the folloeing dropdown list code on my site and have found that it doesnt work properly in IE. Sometimes it works.... Sometimes it doesnt 'jump to page'

    PHP Code:
    <script type="text/javascript">
    function 
    jump(obj){
    if(
    obj.selectedIndex != 0){
    window.location=obj.options[obj.selectedIndex].value;
    }else{
    alert('Please Select!!!');
    }
    }
    </script> 

    PHP Code:
     <form name="form1">
           <
    select name="jump1" OnChange="location.href=form1.jump1.options[selectedIndex].value"
        <
    option value="aaaa">somthing</option
    Can anyone please help?

  2. #2
    SitePoint Guru
    Join Date
    Sep 2006
    Posts
    731
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your <select> has an inline event handler so what is the relevance of the jump function?

    Code:
    <select onchange = "if( this.selectedIndex > 0 ){ location.href = this.value; }">
    Alternatively
    Code:
    function jump( box )
    {
     if( box.selectedIndex > 0 )
      location.href = box.value;
    }
    
    .....
    
    <select onchange = "jump( this )">
    Tab-indentation is a crime against humanity.

  3. #3
    SitePoint Guru adammc's Avatar
    Join Date
    Aug 2004
    Location
    Cairns, Australia
    Posts
    762
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    a little over my head but..... I tried your code and it didnt jump at all

  4. #4
    SitePoint Guru
    Join Date
    Sep 2006
    Posts
    731
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by adammc View Post
    a little over my head but..... I tried your code and it didnt jump at all
    Time to show a URL or complete test page.
    Tab-indentation is a crime against humanity.


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
  •