SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Sep 2002
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Submit Buttons Opening New Windows

    Is there a way of making a submit button open a page in a new window? For example, could I make:

    Code:
    <input type="image" src="go.gif" height="27" width="23" name="image" />
    open in '_parent'?

    Thanks.

  2. #2
    SitePoint Enthusiast Grubilo's Avatar
    Join Date
    Oct 2002
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There are two ways you can use.
    First, is plain HTML syntax.

    You should place:
    target=_blank
    or
    target=_parent

    inside the FORM tag
    <FORM target=_blank method=post action=script.cgi>
    ...
    <input type=submit value="click me">
    </FORM>

    The second way is to use JavaScript but you will not be able to use POST method in this case...so I suggest you the first way
    Web tutorials
    http://webclass.ru

  3. #3
    SitePoint Member
    Join Date
    Sep 2002
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks a lot. Just a couple of other questions.

    Firstly, how do I use javascript to give the user the option of closing the window without the default windows 'x'? Secondly, how can I have a link which opens up a page in a _parent window, while closing the current window?

    Secondly, when opening up a page of set proportions I use javascript. Basically, when you click an image, the page opens up. To give the effect that it is a link, I inserted '#'. While this means a new page does not load here, it also means the current page returns to the top. What can I do?

    Thanks.

  4. #4
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you can have a link that closes the window...like so:
    Code:
    <a href="#" onClick="self.close();" class="red">close this window</a>
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  5. #5
    SitePoint Member
    Join Date
    Sep 2002
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, but is there a way of closing one browser window, while opening a new one (_parent), using the same link? Also, is there a way of closing the window without being promted, "do you want to do so"?


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
  •