Wordpress sendform抛出'未捕获的ReferenceError:未定义sendform'

问题描述 投票:0回答:1

我已经制作了一个登录表单,它在普通的HTML页面中工作。但是当我把它放入wordpress时,提交按钮不起作用。如果我将代码放入Dreamweaver并在浏览器中打开它确实有效。只有在wordpress中使用相同但不起作用的代码才会说:

未捕获的ReferenceError:未定义sendform

我的代码:

<div class="client-area"><form action="https://extranet.proden.com/Proden/Client-Area/LogSys/Log.asp" method="POST" name="LoginClient">
<table>
<tbody>
<tr>
<td>Username:</td>
<td><input tabindex="1" onkeypress="if (event.keyCode == 13) {this.form.submit();}" type="text" name="Username" size="16" /></td>
<td rowspan="2"><a href="javascript:sendform()"><img style="box-shadow: none;" title="Submit login" alt="Submit login" src="http://altitudeconseil.ca/clients/proden/wp-content/uploads/2013/01/login_submit.png" width="61" height="50" />
</a></td>
</tr>
<tr>
<td>Password:</td>
<td><input tabindex="2" onkeypress="if (event.keyCode == 13) {this.form.submit();}" type="password" name="Password" size="16" /></td>
</tr>
<tr>
<td colspan="3"><input type="hidden" name="autoLoginHidden" value="N" />
<p style="text-align: center; font-size: small;"><input id="Checkbox1" tabindex="3" type="checkbox" name="autoLogin" value="true" />Remember me (cookies must be enabled).</p>
<input type="hidden" name="lang" value="English" /></td>
</tr>
</tbody>
</table>
</form>
<p style="font-size: small;">Please enter your username and password. If you do not have access, please <a href="mailto:[email protected]">contact us</a> and a profile will be created for you.</p>

</div>
<script type="text/javascript">
function sendform() {
            if(document.LoginClient.autoLogin.checked)
                document.LoginClient.autoLoginHidden.value = "Y";
            else
                document.LoginClient.autoLoginHidden.value = "N";           
            document.LoginClient.submit()
        }
        //alert('For testing purposes the input fields are filled already.')

</script>

<script type="text/javascript" src="cookies.js"></script><script type="text/javascript">
var cookie = readCookie("ZC_login");
        if(cookie)
        {
            //window.status = 'username is : ' + document.LoginClient.Username.value + ' should be : ' + cookie;
            document.LoginClient.Username.value = cookie;
            document.LoginClient.Password.focus();

            var password = readCookie("ZC_password");
            var autoLogin = readCookie("ZC_autologin");
            if(autoLogin &#038;&#038; autoLogin == "Y")
            {               
                document.LoginClient.autoLogin.checked = true;
                document.LoginClient.Password.value = password;
                sendform();
            }
        } else {
            document.LoginClient.Username.focus();
        }

</script>
javascript wordpress send
1个回答
0
投票

由于一些原因,Wordpress phpmailer或通过联系表单从您的Wordpress网站发送表单可能已经死亡。最普遍的。

  • phpmailer没有启用你的主机 - 或者你正在运行一个关闭php版本,或者你的服务器上发生了一些奇怪的事情。联系您的主机提供商。
  • 还有大量的插件可以帮助解决问题,通过将您的邮件选项切换到SMTP或清除阻止phpmailer成功的问题(也可能与主题相关)

查看一些评价最高的WP邮件插件:http://wordpress.org/plugins/tags/phpmailer

如果一些经过良好评估的插件不起作用 - 请联系您的主机,他们应该能够启用。

其他资源:

© www.soinside.com 2019 - 2024. All rights reserved.