33 users online (0 members and 33 guests)  


  Results 1 to 5 of 5

Related

  1. Verifing Window 'size' upon Opening a File.    Forum: Javascript Forum
    Replies: 8
  2. Opening a new window    Forum: HTML Forum
    Replies: 12
  3. Opening New Window    Forum: Javascript Forum
    Replies: 9
  4. javascript-help with opening in frame window    Forum: Javascript Forum
    Replies: 1
  5. Page opening in new window - Help    Forum: HTML Forum
    Replies: 7
  1. #1
    mwerking
    mwerking's Avatar
    Guest

    Question problem with javascript opening a new window

    this javascript program let's you pick a menu item and click a button and it takes you to the url for that page, however i con't get it to open this page in a new window. it keeps opening in the same window. what do i need to add or change? i'm new to this so i'm not sure what command i need. please help.

    <FORM NAME="WrongChild54">
    <SELECT NAME="a">
    <OPTION VALUE = "http://www.thesecretcavern.com/states/california.html">California<OPTION VALUE = "http://www.thesecretcavern.com/states/connecticut.html">Connecticut<OPTION VALUE = "http://www.thesecretcavern.com/states/indiana.html">Indiana<OPTION VALUE = "http://www.thesecretcavern.com/states/louisiana.html">Louisiana<OPTION VALUE = "http://www.thesecretcavern.com/states/maine.html">Maine<OPTION VALUE = "http://www.thesecretcavern.com/states/maryland.html">Maryland<OPTION VALUE = "http://www.thesecretcavern.com/states/massachusetts.html">Massachusetts<OPTION VALUE = "http://www.thesecretcavern.com/states/newhampshire.html">New Hampshire<OPTION VALUE = "http://www.thesecretcavern.com/states/newyork.html">New York<OPTION VALUE = "http://www.thesecretcavern.com/states/ohio.html">Ohio<OPTION VALUE = "http://www.thesecretcavern.com/states/pennsylvania.html">Pennsylvania<OPTION VALUE = "http://www.thesecretcavern.com/states/rhodeisland.html">Rhode Island<OPTION VALUE = "http://www.thesecretcavern.com/states/southcarolina.html">South Carolina<OPTION VALUE = "http://www.thesecretcavern.com/states/virginia.html">Virginia<OPTION VALUE = "http://www.thesecretcavern.com/states/unknown.html">Unknown</SELECT><INPUT TYPE="button" VALUE="Load Page" onclick="location.href = this.form.a.options[this.form.a.selectedIndex].value"></FORM><noscript><ul><li><A HREF="http://www.thesecretcavern.com/states/california.html">California</a><br><li><A HREF="http://www.thesecretcavern.com/states/connecticut.html">Connecticut</a><br><li><A HREF="http://www.thesecretcavern.com/states/indiana.html">Indiana</a><br><li><A HREF="http://www.thesecretcavern.com/states/louisiana.html">Louisiana</a><br><li><A HREF="http://www.thesecretcavern.com/states/maine.html">Maine</a><br><li><A HREF="http://www.thesecretcavern.com/states/maryland.html">Maryland</a><br><li><A HREF="http://www.thesecretcavern.com/states/massachusetts.html">Massachusetts</a><br>
    <li><A HREF="http://www.thesecretcavern.com/states/newhampshire.html">New
    Hampshire</a><br>
    <li><A HREF="http://www.thesecretcavern.com/states/newyork.html">New York</a><br><li><A HREF="http://www.thesecretcavern.com/states/ohio.html">Ohio</a><br><li><A HREF="http://www.thesecretcavern.com/states/pennsylvania.html">Pennsylvania</a><br><li><A HREF="http://www.thesecretcavern.com/states/rhodeisland.html">Rhode Island</a><br><li><A HREF="http://www.thesecretcavern.com/states/southcarolina.html">South Carolina</a><br><li><A HREF="http://www.thesecretcavern.com/states/virginia.html">Virginia</a><br><li><A HREF="http://www.thesecretcavern.com/states/unknown.html">Unknown</a><br></ul></noscript>

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662

    Post

    Ahhh, I know this one. But I'm going out. Will post in a few houra, Ok?

    ------------------
    QuietDean-

  3. #3
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662

    Post

    oops.

    Don't forget the <!-- and //--> in the function, either.

  4. #4
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662

    Post

    We need to use a function, so paste this into your <HEAD> section -

    <script language="javascript">
    function badger() {
    x = document.WrongChild54.a.options[document.WrongChild54.a.selectedIndex].value;
    window.open(x);
    }

    </script>

    Once done, change the onClick command to -

    onClick="badger()"

    That works for IE. haven't checked Netscape.

    ------------------
    QuietDean-

  5. #5
    mwerking
    mwerking's Avatar
    Guest

    Talking

    Thanks! i'll write all that down. Thanks again!



Tags for this Thread