2014-02-12 141 views
0

我做了一个表单登录,在一个正常的HTML页面工作。但是,当我把它放在wordpress提交按钮不起作用。这里是我的代码...就像我说的,如果你把代码放在Dreamweaver中并在浏览器中打开它,它确实有效。只有在wordpress中使用相同的代码,它不工作它说:Uncaught ReferenceError:sendform没有定义wordpress 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> 

回答

0

Wordpress phpmailer或通过联系表格从Wordpress网站发送表单可能会因为几个原因而死机。最常见的。

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

  • 也有吨的插件,或许可以通过切换邮件选项,SMTP或在PHPMailer的清理的预防 问题的成功(这也可能是主题 协助 问题,即工作相关的还有)

检查出一些最精彩的WP邮件插件:http://wordpress.org/plugins/tags/phpmailer

如果一些知名评论插件不工作 - 联系您的主机,他们应该能够启用。

其他资源: