簡體   English   中英

將用戶數據解析為mailto表單的&body屬性

[英]Parsing user data into &body attribute of mailto form

我有這個腳本:

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錯誤,但是當電子郵件窗口打開時,正文和主題為空白。

有人可以幫忙嗎? 提前謝謝了!

帶有mailto: uris的表單支持太差,無法在WWW上使用。

如果要使用表單收集數據,則需要使用HTTP(S)URI作為操作,並在服務器上處理提交的數據。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM