Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jul 2002
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question specifying size of target window

    hi,

    Is there a way to specify the size and position of the [target="_blank"] window in the following code?

    Thanks!

    <form action='http://www.elia.org/search/default.asp' method='post' target="_blank">
    <input name=Criteria type=text size=12 maxlength=50>&nbsp;<input class=bodytext name=submit type=submit value=' Go '>

  • #2
    Senior Coder chilipie's Avatar
    Join Date
    Jul 2004
    Location
    Shrewsbury, UK Age: 16
    Posts
    1,117
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You could only do this with JS... Messing with the user's browser window is not a good idea - it tends to make people mistrust you.

  • #3
    Regular Coder
    Join Date
    May 2004
    Location
    Berkeley, California Age: 15
    Posts
    398
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I agree with chilipie, however window resizing in target windows is acceptable IMO. However, I think you could have searched a little harder before posting. This very forum is infested with such questions, as is a quick google search. Anyhoo, here's how

    <a href="link.html" target="AutoWindow" onClick="window.open('','AutoWindow',& #39;toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,r
    esizable=no,width=400,height=480')">Link</a>

    I assume you know how to change all that to your specifications..
    Jalenack.com .:. YWDA Founder .:. Rounded Corners Maker 1.1! .:. My Blog
    The hardest thing about teaching is not knowing the right answers, but knowing the right questions - Elisabeth Klein
    Pretty buttons does not a great website make.

  • #4
    New Coder
    Join Date
    Jul 2002
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    having problem because it's a form button

    Thanks for the help. I'm sorry I wasn't clear enough in my first question. My question is more than just opening a new window.

    I know how to open new window from a link, but I am having a problem because this is part of a form.

    When I apply the JS to the "Go" button, the new window opens, but the search results page also opens. If I don't specify _blank in the code, the results page still opens in the original page. Then I have the results page in the original page and the new window.

    What I am trying to do is to open a new page (specifying the size and position) with the search results in it, but have the original page stay as is.

    (Here is the code again)

    <form action='http://www.elia.org/search/default.asp' method='post' target="_blank">
    <input name=Criteria type=text size=12 maxlength=50>&nbsp;<input class=bodytext name=submit type=submit value=' Go '>

  • #5
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    I'm afraid there isn't any way of doing this using HTML/CSS only. You're asking to change the default browser behavior, which is in the realm of Javascript (maybe even server-side programming like PHP). Pick which ever program you hate the least and pm a moderator to move this question to the appropriate forum, that should help you get the answers you need...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •