[英]HTML webform button to add text to an email field
I have a pretty basic webform: First, Last, email. 我有一个非常基本的网络表单:首先,最后是电子邮件。
I would like to create options/buttons that add text to the email field. 我想创建将文本添加到电子邮件字段的选项/按钮。 Predetermined buttons that contain: @yahoo.com, @gmail.com, etc. Whether it's just a link/text or an actual button.
预定的按钮包含:@ yahoo.com,@ gmail.com等。它只是链接/文本还是实际的按钮。 Can't figure it out!
无法解决!
Thank you! 谢谢!
Billy 比利
You can add a select box whose chosen value can be supplied to textbox using js/jquery, and add the options whenever you need to add more mail engines; 您可以添加一个选择框,使用js / jquery可以将选择的值提供给文本框,并在需要添加更多邮件引擎时添加选项。 that would help u in long run as adding button u would have compromise with ui if u need to add more search engines
从长远来看,这将对您有所帮助,因为如果您需要添加更多搜索引擎,则您会在ui方面做出妥协
A select would look better according to me, as used on fakemailgenerator 根据我的说法, select看起来更好,如fakemailgenerator上所使用
<select name="email-domain">
<option value="gmail">@gmail.com</option>
<option value="yahoo">@yahoo.com</option>
<option value="outlook">@outlook.com</option>
</select>
Here is a jsfiddle snippet to see working example https://jsfiddle.net/d713yvbf/ 这是一个jsfiddle片段,以查看工作示例https://jsfiddle.net/d713yvbf/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.