I created this contact form, it works perfectly in firefox and chrome but in internet explorer it wont allow you to input text (clicking on the form fields does nothing) the submit button works but only sends a blank message because no text can be entered. Also when you press submit it tries to open mail.php in a firefox page, i am only testing locally on my pc could this be the issue?

我创建了这个联系表单,它在firefox和chrome中完美运行但在Internet Explorer中它不允许你输入文本(点击表单字段什么都不做)提交按钮有效但只发送一条空白消息,因为没有文本可以输入。此外,当你按提交它尝试在firefox页面中打开mail.php,我只在我的电脑上本地测试可能这是问题吗?

PHP is this :

PHP是这样的:

<?php
    $name = $_POST['name'];
    $email = $_POST['email'];
    $phone = $_POST['phone'];
    $message = $_POST['message'];
    $formcontent="This message has been generated from the Contact page \n Name: $name \n Phone: $phone \n Email: $email \n Message: $message";
    $recipient = "myemail@myemail.co.uk";
    $subject = "Enquiry From contact page";
    $mailheader = "From: $email \r\n";
    mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
    header('Location: ../contact2.html');
?>

HTML is:

HTML是:

<form id="form1" action="PHP/mail.php" method="post">
    <label>Name <span class="small">Add your name</span></label> 
    <input type="text" name="name"><br>
    <label>Email <span class="small">Enter a Valid Email</span></label> 
    <input type="text" name="email"><br>
    <label>Phone <span class="small">Add a Phone Number</span></label> 
    <input type="text" name="phone"><br>

    <br>
    <br>

    <label>Message <span class="small">Type Your Message</span></label> 
    <textarea name="message" rows="6" cols="25">
    </textarea><br>
    <button type="submit" value="Send" style="margin-top:15px;">Submit</button>
    <div class="spacer"></div>
</form>

2 个解决方案

#1


0

Based on purely on the form you have I was able to enter text in the form in Chrome, FireFox and IE8.

基于您的表单,我能够在Chrome,FireFox和IE8中输入表单中的文本。

Take your html form code and place it in an independent file HTML file and test in IE to see if you get the same behavior.

获取您的html表单代码并将其放在一个独立的文件HTML文件中,并在IE中进行测试,看看您是否得到了相同的行为。

Testing an HTML file will narrow the problem down to just checking the browser removing other variables like your PHP server or javascript.

测试HTML文件会将问题缩小到只检查浏览器,删除其他变量,如PHP服务器或javascript。

-If you get the same issue: it is a IE issue independent to that PC.

- 如果你遇到同样的问题:这是一个独立于该PC的IE问题。

-If you do not get the same issue: it may be a problem with your php configuration or javascript.

- 如果你没有得到同样的问题:它可能是你的PHP配置或JavaScript的问题。

            <form id="form1" action="PHP/mail.php" method="post">
                <label>Name <span class="small">Add your name</span></label> <input type="text" name="name" /><br />
                <label>Email <span class="small">Enter a Valid Email</span></label> <input type="text" name="email" /><br />
                <label>Phone <span class="small">Add a Phone Number</span></label> <input type="text" name="phone" /><br />
                <br>
                <br>
                <label>Message <span class="small">Type Your Message</span></label> 
                <textarea name="message" rows="6" cols="25">
                </textarea><br>
                <button type="submit" value="Send" style="margin-top:15px;">Submit</button>
                <div class="spacer"></div>
            </form>

更多相关文章

  1. 如何使用jQuery在我的网站演示中自动填写表单,好像真人正在打字?
  2. 禁用div中的所有表单元素
  3. js去掉html标签和去掉字符串文本的所有的空格
  4. 在HTML / PHP联系表单上出现404/405错误(链接问题?)
  5. JSF和HTML表单的Unicode问题?
  6. 如何将添加到ajax html编辑器的文本保存为html文档?
  7. 如何将每个单词都包含在一个span中,同时保留文本格式
  8. 文本输入占位符不在IE和Firefox中显示
  9. 如何使用struts2访问表单数组字段

随机推荐

  1. JSP中--->中文乱码问题
  2. 在Java中修剪可能的字符串前缀
  3. java7 switch语句使用字符串
  4. 如何在Spring中读取具有相同键的多个属性
  5. java中的异常处理
  6. java中两个事物,怎么设置,能让一个事物出现
  7. 基于内容估计文本宽度的算法
  8. JavaScript中的map()函数
  9. Java面试题--基础知识部分
  10. Hbase1.1.x Java版之批量查删操作