Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8746541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:12:37+00:00 2026-06-13T12:12:37+00:00

Ok I have googled for hours and found nothing that works. I need help

  • 0

Ok I have googled for hours and found nothing that works. I need help desperately

I have got a form with the following elements in it.

<form action="sendmail.php" method="post" name="enquiry">
    <table> 
        <tr>
            <td>Name:-</td> 
            <td><input type="text" name="name" /></td>
        </tr> 
        <tr>
            <td>Company:-</td>
            <td> <input type="text" name="company" /></td>
        </tr>
        <tr>
            <td>E-Mail:-</td>
            <td><input type="text" name="email" /></td> 
        </tr>
        <tr>
            <td>Contact:-</td>
           <td> <input type="text" name="contact" /></td>
        </tr>
        <tr>
            <td>Requirement:-</td>
            <td><textarea name="msg"></textarea></td>
        </tr>
    </table>
    <input type="submit" value="submit" onclick="return validation(this.form);">
    <input type="reset" value="Reset" />
</form>

and the php has a line like this:

<?php
if(mail($to, $subject,$message)) {
   echo "<SCRIPT LANGUAGE='JavaScript'>alert('Your Enquiry was sent successfully we  will get back to you shortly');
              window.location.href='javascript:history.go(-1)';
              document.enquiry.reset();
         </SCRIPT>";
}
?> 

Then there’s an “else” with the same code but a different message.

The problem is when it redirects back to the form page it still has the data in the fields. What I prefer is a clean form with no data filled in when the user returns to the page.

Please note I am a newbie to javascript so try suggesting a fix that would be easy to comprehend.

Thanks a lot in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T12:12:38+00:00Added an answer on June 13, 2026 at 12:12 pm

    That’s because you’re going back in the history – browsers remember forms when you go back/forward.

    What you are doing isn’t a “normal” user experience – I would suggest you print out a nice looking page saying thanks in the “sendmail.php” file and then let the user navigate to wherever they want to on your site.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have googled in the last 3 hours but i can't seem to find
This is for certain a newbie mistake, I have googled for plenty of hours
I have Googled a lot and found a lot of solutions, but none of
I have googled the topic for a while but haven't found what I'm looking
i have googled and came to know that how to use the variable arguments.
I've searched stackoverflow and googled four a couple of hours and still not found
Been banging my head on this for 8 hours now... I have a need
After researching this issue for a couple of hours, I found that one of
I normally don't ask for help. I have spent 3 plus hours trying to
EDIT: I believe i may have found the problem. I need to work on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.