如何验证emial和密码 [英] how to validate a emial and password
本文介绍了如何验证emial和密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个电子邮件文本字段和passwrd文本域
i想要发送电子邮件只接受那些适合电子邮件地址的值,如雅虎电子邮件
和密码
我的英语不太好,但我想你明白我的问题
Regar Mian Sahib jan
解决方案
>
使用此javascript
function checkEmail(){
var email = document.getElementById(' txtEmail 跨度>);
var emailFormat = /^([a-zA-Z0-9_\.\-])+\@(([a-azA -Z0-9 \ - ])+ \。)+([a-zA-Z0-9] { 2 , 4 跨度>})+
/;
if (!emailFormat.test(email。 value )){
alert(' 无效的电子邮件');
email.focus;
return false ;
}
祝你好运
你可以通过常规来达到这个目的表达式验证器
请参阅:
ASP.NET中的RegularExpressionValidator [ ^ ]
me have an email textfield and passwrd textfield
i want to email take only those value which is suitabl for email address like yahoo email
and password
my english are not so well but i think u understand my question
Regar Mian Sahib jan
解决方案
Hi,
use this javascript
function checkEmail() { var email = document.getElementById('txtEmail'); var emailFormat = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+
/; if (!emailFormat.test(email.value)) { alert('Invalid Email'); email.focus; return false; }
Good Luck
You can achieve this by Regular Expression validator
See this:
RegularExpressionValidator In ASP.NET[^]
这篇关于如何验证emial和密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文