簡體   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