SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Form return page into pop-up window

    Kinda an addendum to the thread titled 'Form - how to make form submit to a new window?' which wasn't discussing quite what I was after, so...

    I have an email form in a DIV on my main page.
    I want to be able to send it and have the returned 'ThankYou' page shown in a pop-up instead of _self (which would replace the entire main page)

    I don't just want a new window, I want the window to be a certain size and position on the screen so I guess i need it to be a javascript pop-up.

    I tried an iFrame, but they always sit on top of everything else regardless of the z-index that is set for them.
    They also ignore any clipping area that they should be clipped by.
    This messes with the layout, so I need to go back to the original idea of having the returned ThankYou page in a pop-up window- I think.

    Do I even need to have a return ThankYou html page?
    Couldn't I just have a DIV that becomes visible and has the ThankYou on it?

    I am using a CGI script that is supplied by my ISP (free webspace).

    action="http://www.mydomain.com/cgi-bin/mailform.cgi"

    In the configuration instructions it gives me a return html page (I just swap in my own url).
    Do I even have to keep that part of the form tag

    Does anyone know a way round this?

    Does anyone understand what I'm on about?

    I hope so

    TIA
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  2. #2
    blonde.... Sarah's Avatar
    Join Date
    Jul 2001
    Location
    Berkshire, UK
    Posts
    7,442
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    the only way that I have done it is to put the thank you url as your main page (i.e. the one with the form) and then link using an onClick javascript event to the submit button (on a delay maybe?) that pops up an alert box saying thank you your form details have now been sent...

    ???

    Sarah
    Regular user

  3. #3
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I guess that would work, but I was hoping not to have to reload the entire page.

    The email form is just one DIV in a page built with layers. I can't help thinking that there must be a way to do it w/o disturbing the rest of the page.

    I wonder if I can simply put a javascript command in the url's place, the same way you can do with regular links.

    action="javascript:doPopup()"

    Any comments?

    Or perhaps even just

    action="#" then just add an onclick to the button.


    PING!

    Just noticed that I'm looking at the wrong hidden input tag.

    <input type="hidden" name="targetpage" value="http://www.mydomain.com/thankyou.html">

    Now maybe if I just leave that out...

    Well, I guess I know now which part I should be messing about with
    Last edited by Bill Posters; Mar 6, 2002 at 07:37.
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  4. #4
    blonde.... Sarah's Avatar
    Join Date
    Jul 2001
    Location
    Berkshire, UK
    Posts
    7,442
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    watch out as their cgi code might look for 'targetpage' so you might have to create on onclick on that event with the popup...

    interesting though would be interested on whether it works or not

    Sarah
    Regular user

  5. #5
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,123
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I would do this as two separate actions.

    Submit the form as per normal, at the same time you are submitting it have the popup come up:

    <form method="post" action="yourcgi.cgi" onSubmit="doPop()">

    Obviously you'll need to customize this, but I think it will do what you are looking for
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  6. #6
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I tried both options.

    CGI wouldn't clear w/o a target return page and the pop-up onsubmit just broke the email address validation script.

    I conceded defeat and defaulted back to a complete page replacement.
    I hate having 20 words saying ThankYou in the middle of a lot of space, but at least I can stick the bloomin site online now

    Thanks for the input you two
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature


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
  •