繁体   English   中英

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

[英]Wordpress sendform throws 'Uncaught ReferenceError: sendform is not defined'

我已经创建了一个表单登录,可以在普通的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:info@proden.com">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>

出于某些原因,Wordpress phpmailer或通过联系表单从您的Wordpress网站发送表单可能已失效。 最常见的。

  • 您的主机未启用phpmailer-或您运行的是非php版本,或者服务器上发生了一些奇怪的事情。 请与您的主机提供商联系。

  • 也有大量的插件可以解决这个问题,可以通过将您的邮件选项切换到SMTP或清除阻止phpmailer成功的问题来工作(也可能与主题相关)

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

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

其他资源:

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM