40 users online (0 members and 40 guests)  


  Results 1 to 6 of 6

Related

  1. What is wrong with this code    Forum: CSS Forum
    Replies: 4
  2. Replies: 3
  3. What is wrong with it??    Forum: Show it off!
    Replies: 1
  4. what am i doing wrong....?    Forum: HTML Forum
    Replies: 1
  1. #1
    Heath's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2002
    Location
    USA
    Posts
    6

    What's wrong with this?

    Im trying to open a new window with scrollbars but this won't work. What gives? (only the first link has a destination url)


    <!-- Start Of Cases Drop Down Links Script -->
    <script language="JavaScript">
    <!-- Hide the script from old browsers --
    function surfto(form)
    {
    var myindex=form.dest.selectedIndex
    window.open(form.dest.options[myindex].value,"main","menubar=1,toolbar=0,location=0,directories=0,status=1,copyhistory=0,resizable=1,scrollbars=1");
    }
    //-->
    </SCRIPT>
    <CENTER>
    <FORM NAME="Cases">
    <select name="dest" SIZE=1>
    <option selected value="">Cases
    <option value="http://www.tigerdirect.com/sectors/extremecases/index.asp#layer">Chieftec Extreme Gamer
    <option value="">Antec PLUS1080AMG
    <option value="">Cooler Master ATC-101
    <option value="">Xaser II A5000A Plus
    <option value="">Xaser II A6000A Plus
    </select>
    <P>
    <INPUT TYPE="BUTTON" VALUE="Sniff it out!" onClick="surfto(this.form)">
    </FORM>
    </CENTER>
    <!-- End Of Drop Down Links Script -->

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Whilst I am unsure what was wrong with it, using the function in this format works fine -

    Code:
    function surfto(obj)
    {
    
    
    var whereto=document.Cases.dest.options[document.Cases.dest.selectedIndex].value
    
    window.open(whereto,"main","menubar=1,toolbar=0,location=0,directories=0,status=1,copyhistory=0,resizable=1,scrollbars=1");
    }
    as does

    Code:
    function surfto(obj)
    {
    
    
    var whereto=obj.dest.options[obj.dest.selectedIndex].value
    
    window.open(whereto,"main","menubar=1,toolbar=0,location=0,directories=0,status=1,copyhistory=0,resizable=1,scrollbars=1");
    }
    Last edited by QuietDean; 12-21-2002 at 02:50 PM.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    Doorknob's Avatar
    Super Newbie

    Status
    Offline
    Join Date
    Jun 2002
    Location
    Malaysia
    Posts
    316
    make sure the values being passed to window.open function are correct, add an alert there. also make sure that the optional stuff being used in window.open (like toolbar=0) are correct. that's where the problem usually crops up.

  4. #4
    Heath's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2002
    Location
    USA
    Posts
    6
    I really appreciate the help. I don't know what's going on, but it still won't work. Check out the beta page at http://www.welan.net/hound.html

    There's only two links under Power Supplies and one link under Cases (which is the code above). Try them out, you will see there is no way to scroll the page it pops up.

    Maybe there is a better way to do what I want to accomplish, any suggestions would be greatly appreciated. I'd like to get fully functional windows to pop up (address bar, menu, scroll, etc.) Thanks again.
    Last edited by Heath; 12-22-2002 at 01:33 PM.

  5. #5
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Try changing the function to the second example above, it should work.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  6. #6
    Heath's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2002
    Location
    USA
    Posts
    6
    Thanks for the help, it wouldn't work untill I replaced all the functions with the same script.



Tags for this Thread