0

我有这个脚本:

function calculate(){

passworda = document.password1.user1.value.toLowerCase()
passwordb = document.password1.pass1.value.toLowerCase()

var user = 1
var pass = 1

for(d=0;d<passwordb.length;d++) {
pass*= passwordb.charCodeAt(d);
}
for(e=0;e< passworda.length; e++) {
user *= passworda.charCodeAt(e);
    }
      document.password1.outputuser1.value = user;
      document.password1.outputpass1.value = pass;
}

这种形式:

<form name="password1" enctype="text/plain" method="get" action="mailto:myemail@mydomain.com?subject=Register&body=A new user has registered with your form. Their username is ' +outputuser1+ ' and their password is ' +outputpass1+ '">
Username:<input type="text" name="user1" />
Password:<input type="password" name="pass1" />
<input type="submit" value="Register" onclick="calculate()" />
<input type="reset" value="Reset" />
</form>

我想要做的是当用户填写此表单并点击提交时,它会通过电子邮件向我发送加密的用户名和密码,替换

&body=A new user has registered with your form. Their username is ' +outputuser1+ ' and their password is ' +outputpass1+ '"

&body=A new user has registered with your form. Their user name is JOHNSMITH and their password is 123456"

当表单被提交时。我没有收到任何 javascript 错误,但是当电子邮件窗口打开时,正文和主题为空白。

任何人都可以帮助这个工作吗?提前谢谢了!

4

1 回答 1

1

mailto:带有uris 的表单在 WWW 上的支持太差了。

如果您想通过表单收集数据,那么您需要使用 HTTP(S) URI 作为操作,并在服务器上处理提交的数据。

于 2012-07-19T16:12:55.253 回答