Results 1 to 5 of 5

Thread: How to Size a Window with target="newwin"

  1. #1
    Join Date
    Dec 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to Size a Window with target="newwin"

    I have a drop down List menu, and when you select an item in the list, It pops up a New Browser as its supposed to using the target="newwin" function. But I also need to size the Popup Browser and cant seem to make it happen.

    Any help would be greatly appreciated..

    Here is what I have so far.

    <form name="form1">
    <select name="select1" size="1" style="background-color:#FFFFD7">
    <option selected>Select your print Item</option>
    <option value="product_display.php?category_id=5" target="newwin" >Business Cards</option>
    <option value="product_display.php?category_id=5" target="newwin" >Tent Cards</option>
    <option value="product_display.php?category_id=2" target="newwin" >Postcards</option>
    <option value="product_display.php?category_id=8" target="newwin" >Letterhead</option>
    AND SO ON..

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    That code will not do what you say. At least not by itself. It looks familiar to me though. Is it this script:

    http://www.dynamicdrive.com/dynamici...bodescribe.htm

    ??

    If so, you would need to edit this function:

    Code:
    function jumptolink(what){
    var selectedopt=what.options[what.selectedIndex]
    if (document.getElementById && selectedopt.getAttribute("target")=="newwin")
    window.open(selectedopt.value)
    else
    window.location=selectedopt.value
    }
    You would add the specifications desired to that line, ex:

    Code:
    window.open(selectedopt.value,'','scrollbars,location,directories,status,menubar,toolbar,resizable,width=300,height=300');
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Dec 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hey John,

    Thanks for the Reply, You are correct about the script that I am using, unfortunately its still not working. Now it wont popup a new browser window at all.

    This is what I have changed the lower script to:

    function jumptolink(what){
    var selectedopt=what.options[what.selectedIndex]
    if (document.getElementById && selectedopt.getAttribute("target")=="newwin")
    window.open(selectedopt.value,",'scrollbars=no,width=630,height=550');
    else
    window.location=selectedopt.value
    }

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Not a single double quote("):

    Code:
    window.open(selectedopt.value,",'scrollbars=no,width=630,height=550');
    Use empty single quotes (') as in my example:

    Code:
    window.open(selectedopt.value,'','scrollbars=no,width=630,height=550');
    It might help to understand that this is where the name of the window would go, if one were desired, ex:

    Code:
    window.open(selectedopt.value,'my_win','scrollbars=no,width=630,height=550');
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Dec 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Perfect!!!!!!!!

    Thank you for the Help.


    Dave

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
  •