繁体   English   中英

将mailto的收件人更改为在文本字段中输入的内容

[英]Changing the recipient of the mailto to what is entered in the text field

我想知道是否有可能制作一种表格,使人们可以将设置了mailto操作的电子邮件更改为在文本字段中输入的内容。

例如:

<form enctype="text/plain" method="get" action="mailto:getElementByName='friend1'" action="cc:manager@crill.com">
Friend 1 <input type="text" name="friend1"><br>
Friend 2 <input type="text" name="friend2"><br>
Friend 3 <input type="text" name="friend3"><br>

<input type="submit" value="Send">
</form> 

因此,如果在名为“ Friend 1”的第一个字段中输入:“ example1@mail.com”,那么当我按Submit时,我希望它获取放入第一个字段中的信息并将其作为mailto。

我为我的英语道歉,希望读过这篇文章的人能理解。 先感谢您。

您可以使用以下方法做到这一点:

<form method="post" action="javascript:;" onSubmit="this.action='mailto:'+document.getElementById('friend1').value;" enctype...>

也请在此处检查: 是否可以仅使用HTML和JavaScript动态设置MAILTO:的收件人?

暂无
暂无

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

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