私はこのスクリプトを持っています:
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 エラーは発生しませんが、メール ウィンドウが開くと、本文と件名が空白になります。
誰でもこれを機能させるのを手伝ってもらえますか? よろしくお願いします!