+ Reply to Thread
Results 1 to 3 of 3

Thread: "Return to Home Page" button on Success.htm

  1. #1
    Join Date
    Feb 2005
    Posts
    11

    Default "Return to Home Page" button on Success.htm

    Russell:

    Thanks to your patience I have the formmail.php system working perfectly.

    I now want to insert a "Return to Home Page" button at the bottom of the page which will:

    1) close the window and

    2) return the user to the Home page.

    I placed this code after the table in success.htm:

    <form action="" method="post" name="home" id="home">
    <a href="http://www.mysite.com/index.php">
    <input type="submit" name="Submit" value="Submit"></a>
    </form>

    When I click the button I receive the standard:

    An error occurred while processing the form.
    Please contact us directly since this form is not working.
    We apologize for any inconvenience this error may have caused.


    I am sure the issue is due to success.htm being driven through formmail.php, but I don't know how to fix it.

    I started out with this code:

    <script language="Javascript" type="text/javascript"><!--
    /*var NS = (navigator.appName == "Netscape");*/
    var VERSION = parseInt(navigator.appVersion);
    if (VERSION > 3) {
    document.write('<input type=button value="Click to print this Page" name="Print" onClick="printit()">');


    document.write('<input type=button value="Return to Home Page" name="Close" onClick="javascript:self.close()">');
    }
    // -->
    </script>


    but this closes down the browser completely when the button is clicked.

    Any thoughts?

  2. #2
    Join Date
    Dec 2003
    Posts
    3,900

    Default Re: "Return to Home Page" button on Success.htm

    Hi,

    The problem is the action of the form you're putting in success.htm - it's empty, so it simply submits to the current URL (which will be formmail.php if success.htm is good_template).

    In fact, you don't want a form at all.

    You simply want a hyperlink back to your home page:
    Code:
    <a href="http://www.mysite.com/index.php">Return to home page</a>
    If you want it to look like a button instead of a link, you can use an image instead. If you want it to act like a button, you can do that too (with a button tag) but it will require JavaScript to work.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  3. #3
    Join Date
    Feb 2005
    Posts
    11

    Default Re: "Return to Home Page" button on Success.htm

    Russell:

    See, I prove I am a newbie every time.

    Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Return All Variables To Form Page On Error
    By cornernote in forum FormMail Subscription Support
    Replies: 12
    Last Post: 31-Oct-2004, 10:20 PM
  2. No return link for badhandler
    By ptr in forum FormMail Subscription Support
    Replies: 3
    Last Post: 27-May-2004, 12:27 AM
  3. "Internal Server Error": What'd I do wrong?
    By sgodun in forum FormMail Subscription Support
    Replies: 4
    Last Post: 16-May-2004, 01:01 AM
  4. Spiders and "The form has an internal error"
    By russellr in forum FormMail Subscription Support
    Replies: 0
    Last Post: 13-May-2004, 10:11 PM
  5. Email contains no "mesg"
    By xuric in forum FormMail Subscription Support
    Replies: 1
    Last Post: 19-Apr-2004, 09:17 PM

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