请问HTML文本框内输入正确的邮件格式的写法,回复立即给分
<input name= "mail " type= "text " /> 如何添加?谢谢
------解决方案-------------------- <script language= "JavaScript ">
function check(){
var msg= " ";
if (document.info.telephone.value.length < 6) {
msg+= "您输入的电话有误!\n\n ";
}
var email_length=document.info.email.value.length;
var tab1=document.info.email.value.indexOf( "@ ");
var domain=document.info.email.value.substring(tab1+1,email_length);
if(tab1==-1 || tab1==0 || domain.indexOf( "@ ")!=-1 || domain.indexOf( ". ")==-1 || (domain.indexOf( ". ")+tab1+2)==email_length || email_length < 5) {
msg+= "您输入的电子信箱有误!\n\n ";
}