SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Jul 2002
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    pop up windows and forms

    I'm stumped with this at the moment. I have a small pop up login window with username and password fields. Instead of a submit button I have an image (a gif with "enter"). When the user clicks on the image I want the pop up window to close and the appropriate page to open in the parent window. But so far I can only get this to work if the input type is a button and not an image. Is it the case that this won't work with input type="image"? Or is there something wrong with my code? What I have so far is
    <input type="image" border="0" src="../images/enter.gif" name="submit" onClick="window.opener.location.href='../client_area/movie.php';window.close();">
    But it's not working. Any ideas on what's wrong? Thanks...

  2. #2
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Something like this perhaps?
    Code:
    <form name="submitForm" target="self.opener" onSubmit="setTimeout('window.close()',500)">
    	.....form stuff....
    	<input type="image" src="submit.gif" onClick="this.form.submit();" />
    </form>
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  3. #3
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That would definately do it!

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  4. #4
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In retrospect, I'm not sure if 'self.opener' is valid for the target. It's correct in javascript, but I dunno if the target attribute will accept it. If not, use this workaround
    Code:
    <script>
    self.opener.name='parentWin';
    </script>
    </head>
    <body>
    <form name="submitForm" target="parentWin" onSubmit="setTimeout('window.close()',500)">
    ....etc.....
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  5. #5
    SitePoint Member
    Join Date
    Jul 2002
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, beetle! The workaround you put up in your second post worked like a dream (without the workaround it gave me a new pop up window). Many thanks....

  6. #6
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anytime...
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev





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
  •