Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Member TheGardener's Avatar
    Join Date
    Jun 2006
    Posts
    62
    Member #
    13332
    I've created a mail form in a Thickbox for use on my site. The mail form is contained within a hidden div which is displayed in the thickbox when the mail button on the page is clicked.

    You can try it here: http://imagegardenphoto.com/lh/home.php?id=gallery. The page is mostly in Japanese, but all you need to do is click on the button with the envelope and then click the button at the bottom of the Thickbox to submit the form.

    When I submit the form in IE, I get the "Page has Expired" notice you usually get when you try to backbutton onto a page with POSTed information. This is the mail form code:

    Code:
        <form method="post" action='home.php?id=<? echo "${filePath}"; ?>&amp;sentmail=yes'>
        <div class="mailPanelLabel">name</div> 
        <div><input type="text" name="name" id="mailPanelName" size="38" /></div> 
        <div class="mailPanelLabel">mail address</div> 
        <div><input type="text" name="sendersaddress" id="mailPanelEmail" size="38" /></div> 
        <div class="mailPanelLabel">title</div> 
        <div><input type="text" name="subject" id="mailPanelSubject" size="38" /></div> 
        <div class="mailPanelLabel">message content</div> 
        <div><textarea rows="8" name="text" id="mailPanelMessage" cols="38"></textarea></div> 
        <div><input type="submit" value="Send" name="Submit" id="mailPanelSendButton" /></div> 
        </form>
    As you see, the form invokes the same page it was submitted from and sets the "sentmail=yes" variable. I have some PHP code that responds to this variable:

    PHP Code:
    <?    
                
    #If the user just filled out the mail form, pop up the thank you message and invoke mail.php to send the mail
                
    if($sentMail == "yes") { include"phpScripts/mailForm/mail.php"; echo"<script type='text/javascript'> openMailThanksMsg(); </script>";}
        
           
    ?>
    mail.php takes the values submitted with the form and sends them to my email account, while openMailThanksMsg() is a Java function that opens up a Thickbox with a "thank you" message.

    Under every browser I've tested but IE, this seems to work fine but with IE it fails as described above. Interestingly, I've noticed that after the form is submitted IE will load the page right up to the point where the above PHP code appears, and then it will fail.

    I think that the inclusion of mail.php is what's messing IE up. Does this mean that IE is somehow forgetting the values passed from the form? How can I fix this? Any advice appreciated.

  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Java is not Javascript.

    IE is retarded and panics every time you try to view a cached version of a POST request. There's nothing you can do to avoid it short or redirecting to a thank-you page completely, or switching from a POST to GET action (not recommended unless you are only using a tiny bit of data, which an e-mail form does not).
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  4. #3
    Member TheGardener's Avatar
    Join Date
    Jun 2006
    Posts
    62
    Member #
    13332
    Thanks, Filburt. I'm sure this is a widely-known problem (though I couldn't find anything about it in Google searches) so I appreciate your taking the time to address it. I've implemented a solution that's more elegant than the original code and sends the email all right under IE, but now IE gags on my Javascript-implemented thank you message, so I'm off to the Javascript forum...


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 03:06 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com