电子邮件输入模式属性 [英] Email Input Pattern Attribute

查看:115
本文介绍了电子邮件输入模式属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我的电子邮件输入字段(HTML用于电子邮件)使用模式为> 1234567Z@student.glasgow.ac.uk 请参阅下面的代码段,我没有收到格拉斯哥的全部内容(只有gla出现)。

I am in the process of using pattern for my email input field (HTML for email) to be 1234567Z@student.glasgow.ac.uk see code snippet below, I am not getting glasgow as full (only gla appears).

试图用各种其他字符串操纵电子邮件的这部分,但无法获得正确的格式

Have tried to manipulate this part of the email with various other strings but unable to get the correct format as outlined earlier.

任何我得到此代码的原因:

Any reason why I am getting this with the code:

Email address:
<input name="email" type='email' pattern=".+ (@student.glasgow.ac.uk)" required />
<input style="float: right;" type="submit" name="submit" value="Subscribe"/>
</form>


推荐答案

您可以通过此代码尝试

<input type="email" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$" />

这篇关于电子邮件输入模式属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆