Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Prevent page redirect on form submit

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #28940
    noahgelman
    Participant

    I have a form set up and it works. A user can type in their email and they’ll receive emails of updates and news. The problem is the page redirects after clicking the submit button. It redirects to a blank page (contact.php) which displays text depending on whether the email went through (i.e "Thank you. I will get back to you very soon." or "Sorry: An error occurred, please try again later.").

    What I want to do is have the form quickly fade out and just use AJAX to load the page text into the div the form was in. Here is my form and script.

    Code:

    Email    

        

    Code:
    Thank you.
    I will get back to you very soon.
    “;
    }
    else
    {
    $result = “Sorry: An error occured, please try again later.”;
    }
    }

    // Output a result Message
    print $result;
    ?>

Viewing 1 post (of 1 total)
  • The forum ‘Back End’ is closed to new topics and replies.