【问题标题】:Form Fancybox Click.Funktion -> .php [duplicate]表单 Fancybox Click.Funktion -> .php [重复]
【发布时间】:2014-11-13 10:21:02
【问题描述】:

这是我的原始 html 代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <meta http-equiv="content-script-type" content="text/javascript" />
    <meta http-equiv="imagetoolbar" content="false" />
    <link href='css/style.css' rel='stylesheet' type='text/css' />
    <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="js/jquery-1.10.1.min.js"></script>
    <script type="text/javascript" src="js/jquery.mousewheel-3.0.6.pack.js"></script>
    <script type="text/javascript" src="js/jquery.fancybox.js?v=2.1.5"></script>
    <link rel="stylesheet" type="text/css" href="css/jquery.fancybox.css?v=2.1.5" media="screen" />
        <script type="text/javascript">
        $(document).ready(function() {
            $("#fancybox-mail").click(function() {
                 $.fancybox.open({
            href : 'kontakt.php',
            type : 'iframe',
            padding : 5
                });
            });             
        });
    </script>
    <style type="text/css">
        .fancybox-custom .fancybox-skin {
            box-shadow: 0 0 50px #222;
        }
    </style>
</head>

<body>
            <form class="pure-form" name="fancy" action="kontakt.php" method="post">
                <p>Name: <input name="name" placeholder="Name" size="25"> E-Mail: <input name="email" placeholder="beispiel@beispiel.de" size="25"><br /></p>
                <textarea style="resize:none" name="comments" cols="65" rows="15"></textarea><br />
                <input type="button" value="Submit" id="fancybox-mail"<br />
            </form>
</body>
</html>

我想将表单中的数据发送到 kontakt.php,但它不起作用。 我想要一个带有我的 kontact.php 结果的框架框。

只有fancybox 可以工作,但POST 不会向kontakt.php 发送任何内容... (没有fancybox也可以)。

我尝试了here 的结果,但它对我没有帮助。

有人有想法吗?

谢谢,

【问题讨论】:

  • 去掉表单标签中的action="kontakt.php",试试
  • 没用,同样的问题。
  • 在控制台中出现关于 jquery 的任何错误
  • 我怎么能接受这个错误,我用的是synology,我现在正在学习php。
  • 我认为这是同样的问题:stackoverflow.com/questions/20865640/…

标签: php forms fancybox


【解决方案1】:

将表单的最后一行替换为

<input type="submit" value="Submit" id="fancybox-mail"/><br />

类型必须是提交按钮

【讨论】:

  • 我替换了它,现在页面自己重新加载了。没有花哨的盒子,没有邮件。
  • 我把 action="kontakt.php" 放回去了。现在我收到一封邮件,里面有信息,但不是一个花哨的盒子。
猜你喜欢
  • 1970-01-01
  • 2013-01-26
  • 1970-01-01
  • 2012-02-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多