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 7025863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:02:19+00:00 2026-05-28T00:02:19+00:00

I have a simple contact form that works in every browser, except IE. It

  • 0

I have a simple contact form that works in every browser, except IE. It will work with IE only if I have IE’s developer toolbar (DT) open. Since I cannot ask people to press F12 if they’re using IE, could someone explain to me why IE is such a pain…doesn’t like the code? And I can’t use the developer tool since the code works when it runs.

What it does when successful: You stay on the same page and a message pops up thanking you for your submission. Data is stored in a database and an email is sent.

What IE without DT open: You redirect to the .php address and have nothing, but the result text. The data is not stored in the database and an email is sent with all info, except the ‘Comment’ piece.

Of course it starts out in HTML with a little JavaScript in the beginning…

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
     <title></title>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
    <link rel="stylesheet" href="css/default.css" />
    <script type="text/javascript">
      $(function() {
        $('#submit').click(function() {
        $('#mbcontainerloading').append('<img src="img/loading.gif" alt="Currently Loading" id="loading" />');

            var name = $('#name').val();
            var email = $('#email').val();
            var comments = $('#comments').val();
            var mathq = $('#mathq').val();

            console.log(name,email,comments,mathq); 

            $.ajax({
                url: 'submit_to_db.php',
                type: 'POST',
                data: 'name=' + name + '&email=' + email + '&comments=' + comments + '&mathq=' + mathq, 


                success: function(result) {
                    $('#response').remove();
                    $('#mbcontainerresponse').append('<p id="response">' + result + '</p>');
                    $('#loading').fadeOut(500, function() {
                        $(this).remove();
                    });
                console.log(result);
                }
            });

            return false;
        });

      });
    </script>
     </head>
      <body>
<form action="submit_to_db.php" method="post">

       <div id="mbcontainer">
        <label for="name">Name</label>
    <input type="text" name="name" id="name" />

    <label for="email">Email Address</label>
    <input type="text" name="email" id="email" />

    <label for="comments">Comments/Concerns</label>
    <textarea rows="5" cols="35" name="comments" id="comments"></textarea>

    <label for="mathq">What is 9 + 3?<br />
    <span class="mathc">(Please answer the question to prevent spam)</span></label>
    <input type="text" name="mathq" id="mathq" />

    <br />
    <input type="submit" name="submit" id="submit" value="Go!" />

    </div>
<div id="mbcontainerloading">
</div>
<div id="mbcontainerresponse">
</div>
</form>
      </body>
    </html>

When I submit in IE without Developer Toolbar (DT), I’m moved to the actual .php page. This should work and does on other browser as leaving you on the page and update from the php portion of the code, which is…

    <?php


    include("dogspw/dogs.inc");
    $cxn = mysqli_connect($host,$user,$passwrd,$hotel) or die ("couldn't connect to server");
    $query = "INSERT into commentsa(name, email, comments, mathq) VALUES (?, ?, ?, ?)";
if ($_POST['mathq']==12) { 
    $stmt = $cxn->stmt_init();
    echo $_POST['name']."<br />";
    echo $_POST['email']."<br />";
    echo $_POST['comments']."<br />";
    echo $_POST['mathq']."<br />";
    if($stmt->prepare($query)) {
        $stmt->bind_param('ssss', $_POST['name'], $_POST['email'], $_POST['comments'], $_POST['mathq']);
        $stmt->execute();
    }

        if($stmt) {
        echo "Thank you. We'll be in touch with you shortly!";
        } else {
        echo "There was a problem. Please try again later.";
        }
echo "...And thanks for answering the question correctly!";
}   
else {
echo "Did you answer the math question?  Your comment was not sent.";
}   
    //setup email

    $to='john@smith.com';
    $subject='Question from smith.com';
    $number=$_POST['mathq'];
    $name=$_POST['name'];
    $email=$_POST['email'];
    $questiona=$_POST['comments'];
    $message="Name:  ".$name. "\r\n" . "Email:  " .$email. "\r\n" . "Question:  " .$questiona;


    if ($number==12){
    mail($to,$subject,$message);
    echo '<br /><span style="background-color:#dfe0fc">An email has been sent to me, as well.<br />Just in case...<a href="http://www.smith.com"><span style="text-decoration: none">Go back to Smith</span></span></a>';
    }
    else 
    {
    echo '<br /><span style="background-color:#dfe0fc">An email was not sent, either.<br />
    Just in case...<a href="http://www.smith.com"><span style="text-decoration: none">Go back to smith</span></span></a>';
    }

    ?>

I’ve walked through each step and obviously do not know that one tweak IE requires for this to run.
I’ve verified that the info is getting to the .php file, and get the response of “Thank you. We’ll be in touch with you shortly!” Not sure where to go from here.
Please help, I greatly appreciate your time and thank you 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-05-28T00:02:20+00:00Added an answer on May 28, 2026 at 12:02 am

    remove the console.log calls. console is undefined in IE, if the developers toolbar is closed.

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

Sidebar

Related Questions

I have a simple contact form with Subject and Message that I want to
I have a simple contact form on a website that has 2 text fields,
Have created simple Ajax enabled contact forms before that have around 12 fields -
I have a simple cakephp form WITH validation that submits to a database. It
I have a simple contact page set up with a form and I am
I have a very simple contact form on my site, Im looking for users
I have a contact form on site which used to work, but since last
I have a very simple contact form with fields like this: <label> First Name<em>*</em>
I'm writing a contact form in ASP.NET MVC. The user will have the ability
I had this simple modal contact form working fine but must have broke it

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.