请帮我看看邮件验证程序不行 check邮件格式的话用正则表达式吧 Google一下 很多 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <html > <head > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" / > <title >Untitled Document </title > </head > <Script language="javascript" > function validate_form() { validity = true; if (!check_empty(document.form.name.value)) { alert( 'Sorry!Please Fill in your name '); return false; } if (!check_email(document.form.email.value)) { alert( 'Sorry!Please Fill in the correct Email address '); return false; } if (!check_empty(document.form.company.value)) { alert( 'Sorry!Please Fill in your company '); return false; } return true; } function check_empty(text) { return (text.length > 0); } function check_email(email) { //var pattern = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/; var pattern = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; flag = pattern.test(email); if(!flag&&email.length>0){ return false; } return true;} </Script > <body > <form name="form" onSubmit="return validate_form()" method="post" action="mailto:[email protected]?subject=Register Training" enctype="text/plain" > <p >You can press "Ctrl" for multiple selection </p > <p > <Select Name="The Trainings" Multiple > <Option value="1.Grounding type according to IEC 60364-4-41 and their protection" Selected >Grounding type according to IEC 60364-4-41 and their protection </Option > <Option value="2.Power Quality problem and the mitigation solutions" >Power Quality problem and the mitigation solutions </Option > <Option value="3.Lightning protection earth measurement and soil resistivity measurement" >Lightning protection earth measurement and soil resistivity measurement </Option > <Option value="4.Power factor and harmonics correction" >Power factor and harmonics correction </Option > <Option value="5.Communication protocol & software training" >Communication protocol & software training </Option > </Select > </p > <p align="center" > <font size="3" > <b > <font size="4" face="Verdana, Arial, Helvetica, sans-serif" >Name </font >: </b > </font > <input name="name" type="text" id="name" size=46 > <br > <b > <font size="4" face="Verdana, Arial, Helvetica, sans-serif" >Email </font > <font size="4" > </font > <font size="3" >: </font > </b > <input name="email" type="text" id="email" size=46 > <br > <b > <font size="4" face="Verdana, Arial, Helvetica, sans-serif" >Company </font > <font size="4" > </font > <font size="3" >: </font > </b > <input name="company" type="text" id="company" size=46 > <br > <b > <font size="4" face="Verdana, Arial, Helvetica, sans-serif" >Telephone </font > <font size="4" > </font > <font size="3" >: </font > </b > <input name="telephone" type="text" id="telephone" size=46 > <br > <b > <font size="4" face="Verdana, Arial, Helvetica, sans-serif" >Comments </font > <font size="4" > </font > <font size="3" >: </font > </b > <br > <textarea name="comments" rows=8 cols=45 wrap=virtual id="txt" > </textarea > </p > </div > </td > </tr > <tr > <td > <div align="center" > <div align="center" > <br > <input type="submit" value="Send" > <input type="reset" value="Reset" > </div > </form > </body > </html > publina:我故意不填内容,好像只能提醒,name和company,email提醒不了亚。 flexigrid 自动适应高度问题 自动缩放 关于document.write中引用函数,其中函数参数的问题 关于Ext页面传参问题 急~~ExtJS 关于时间与double类型转换显示的问题!!! ajax小问题 [分享]一个封装的Javascript类,请多指教 javascript生成word怎么弄啊!!高手请进!!!很急啊~~~~~~~ 怎么从表单中取出一组CheckBox对象? 支付宝的一个时间轴控件实现 多行文本溢出显示省略号,鼠标经过显示隐藏文字怎么实现? 关于Array.sort() 梅花雪日历控件的问题,怎样防止第二次调用默认的日期与第一次调用的日期一样
<head >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" / >
<title >Untitled Document </title >
</head >
<Script language="javascript" >
function validate_form() {
validity = true;
if (!check_empty(document.form.name.value))
{
alert( 'Sorry!Please Fill in your name ');
return false;
}
if (!check_email(document.form.email.value))
{
alert( 'Sorry!Please Fill in the correct Email address ');
return false;
}
if (!check_empty(document.form.company.value))
{
alert( 'Sorry!Please Fill in your company ');
return false;
}
return true;
} function check_empty(text) {
return (text.length > 0);
}
function check_email(email) {
//var pattern = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/;
var pattern = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
flag = pattern.test(email);
if(!flag&&email.length>0){
return false;
}
return true;
}
</Script >
<body >
<form name="form" onSubmit="return validate_form()" method="post" action="mailto:[email protected]?subject=Register Training" enctype="text/plain" >
<p >You can press "Ctrl" for multiple selection </p >
<p >
<Select Name="The Trainings" Multiple >
<Option value="1.Grounding type according to IEC 60364-4-41 and their protection" Selected >Grounding type according to IEC 60364-4-41 and their protection </Option >
<Option value="2.Power Quality problem and the mitigation solutions" >Power Quality problem and the mitigation solutions </Option >
<Option value="3.Lightning protection earth measurement and soil resistivity measurement" >Lightning protection earth measurement and soil resistivity measurement </Option >
<Option value="4.Power factor and harmonics correction" >Power factor and harmonics correction </Option >
<Option value="5.Communication protocol & software training" >Communication protocol & software training </Option >
</Select >
</p >
<p align="center" > <font size="3" > <b > <font size="4" face="Verdana, Arial, Helvetica, sans-serif" >Name </font >: </b > </font >
<input name="name" type="text" id="name" size=46 >
<br >
<b > <font size="4" face="Verdana, Arial, Helvetica, sans-serif" >Email </font > <font size="4" > </font > <font size="3" >: </font > </b >
<input name="email" type="text" id="email" size=46 >
<br >
<b > <font size="4" face="Verdana, Arial, Helvetica, sans-serif" >Company </font > <font size="4" > </font > <font size="3" >: </font > </b >
<input name="company" type="text" id="company" size=46 >
<br >
<b > <font size="4" face="Verdana, Arial, Helvetica, sans-serif" >Telephone </font > <font size="4" > </font > <font size="3" >: </font > </b >
<input name="telephone" type="text" id="telephone" size=46 >
<br >
<b > <font size="4" face="Verdana, Arial, Helvetica, sans-serif" >Comments </font > <font size="4" > </font > <font size="3" >: </font > </b >
<br >
<textarea name="comments" rows=8 cols=45 wrap=virtual id="txt" > </textarea >
</p >
</div > </td >
</tr >
<tr >
<td >
<div align="center" >
<div align="center" >
<br >
<input type="submit" value="Send" >
<input type="reset" value="Reset" >
</div >
</form >
</body >
</html >
我故意不填内容,好像只能提醒,name和company,email提醒不了亚。