检查@和的电子邮件地址。人物 [英] checking email address for @ and . characters
问题描述
大家好!
任何人都可以告诉我如何在表格上查看并通过电子邮件发送这两个字符
存在的字段。
亲切的问候
Marc
Hi all!
Can anyone show me how to check and email field on a form for the
existence of these two characters.
Kind regards
Marc
推荐答案
libsfan01写道:
libsfan01 wrote:
任何人都可以告诉我如何在表格上检查并通过电子邮件发送这两个字符的存在。
Can anyone show me how to check and email field on a form for the
existence of these two characters.
>
< html>
< head>
< meta http-equiv =" Content-Type"
含量=" text / html的; charset = iso-8859-1">
< script type =" text / javascript">
//验证格式所以******* @ otherchars.yeto 赞助商
功能cM(){
/.+@.+\..+/.test(document.mF.email.value)?
alert(''确定''):警告(''不行'');
}
< / script>
< / head>
< body> ;
< form name =" mF" action =" script.php">
< input type =" text" name =" email">
< input type =" button"值="!检查" onClick =" cM()">
< / form>
< / body>
< / html>
(感谢John Stockton博士,
http://www.merlyn.demon.co.uk/js-valid.htm#VEmA )
-
Bart
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<script type="text/javascript">
// validates the format so*******@otherchars.yetotherchars
function cM() {
/.+@.+\..+/.test(document.mF.email.value) ?
alert(''OK'') : alert(''not OK'');
}
</script>
</head>
<body>
<form name="mF" action="script.php">
<input type="text" name="email">
<input type="button" value="Check!" onClick="cM()">
</form>
</body>
</html>
(thanks Dr John Stockton,
http://www.merlyn.demon.co.uk/js-valid.htm#VEmA)
--
Bart
Bart Van der Donck写道:
Bart Van der Donck wrote:
function cM(){
/.+@.+\..+/.test(document.mF.email.value)?
alert(''OK''):alert(''not OK'');
}
function cM() {
/.+@.+\..+/.test(document.mF.email.value) ?
alert(''OK'') : alert(''not OK'');
}
或
/^[0-9a-z+_\.\-]+@([0-9a-z + _ \。\ - ] + \。)+ [az] {2,4}
Or
/^[0-9a-z+_\.\-]+@([0-9a-z+_\.\-]+\.)+[a-z]{2,4}
/ i
尽管我我不确定
电子邮件地址中实际允许哪些字符。
使用上面的代码。@ ...%0dBcc:sp ** @ example.net; mo ** @ example.net似乎是一个
完全有效的电子邮件地址..
再说一次,我不知道在验证的地方,它可以是
就足够了。
Grtz,
-
Rik Wasmus
/i
Allthough I''m not sure which characters are actually allowed in an
emailadress.
With the above code .@...%0dBcc:sp**@example.net;mo**@example.net seems a
totally valid emailadress..
Then again, I don''t know where the validation is for, it could be
sufficient.
Grtz,
--
Rik Wasmus
这篇关于检查@和的电子邮件地址。人物的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!