JQuery表单验证插件EasyValidator
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link href="../Scripts/validate/css/validate.css" rel="stylesheet" type="text/css" />
<script src="../Scripts/validate/js/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="../Scripts/validate/js/validate.pack.js" type="text/javascript"></script>
</head>
<body>
<form id="form1" runat="server" name="validateForm">
<table width="800" border="0" class="ad" cellpadding="0" cellspacing="1" bgcolor="#999999" id="testTable">
<tr bgcolor="#ffffff">
<td align="right" bgcolor="#EEEEEE" width="150px" style="padding-left: 5px; padding-top: 4px; padding-bottom: 4px; padding-right: 18px;">
玩家账号 :
</td>
<td align="left" style="padding-left: 5px; padding-top: 4px; padding-bottom: 4px; padding-right: 18px;">
<%--<input name="flightno" type="text" id="flightno" reg="^\w{2}\d+$" /> --%>
<asp:TextBox ID="txt_name" name="txt_name" runat="server" reg="^\w{2}\d+$" Width="200"></asp:TextBox>
<span name="easyTip">(游戏商名称[2个字母简写]+用户ID[数字] 如: sd10059)</span>
</td>
</tr>
<tr bgcolor="#ffffff">
<td align="right" bgcolor="#EEEEEE" width="150px" style="padding-left: 5px; padding-top: 4px; padding-bottom: 4px; padding-right: 18px;">
中文姓名 :
</td>
<td align="left" style="padding-left: 5px; padding-top: 4px; padding-bottom: 4px; padding-right: 18px;">
<asp:TextBox ID="txt_cname" name="txt_cname" runat="server" reg="^[\u4e00-\u9fa5]+$" Width="200"></asp:TextBox>
<%--<input name="floatNum" type="text" id="floatNum" reg="^[\u4e00-\u9fa5]+$" /> --%>
<span name="easyTip">(只允许中文字符)</span>
</td>
</tr>
<tr bgcolor="#ffffff">
<td align="right" bgcolor="#EEEEEE" width="150px" style="padding-left: 5px; padding-top: 4px; padding-bottom: 4px; padding-right: 18px;">
电话号码 :
</td>
<td align="left" style="padding-left: 5px; padding-top: 4px; padding-bottom: 4px; padding-right: 18px;">
<asp:TextBox ID="txt_phone" name="txt_phone" runat="server" reg="^\d{3}-\d{8}$|^\d{4}-\d{7}$" Width="200"></asp:TextBox>
<%--<input name="str" type="text" id="str" reg="^\d{3}-\d{8}$|^\d{4}-\d{7}$" /> --%>
<span name="easyTip">(国内电话号码,格式: 0832-4405222 或 021-87888822
)</span>
</td>
</tr>
<tr bgcolor="#ffffff">
<td align="right" bgcolor="#EEEEEE" width="150px" style="padding-left: 5px; padding-top: 4px; padding-bottom: 4px; padding-right: 18px;">
邮箱地址 :
</td>
<td align="left" style="padding-left: 5px; padding-top: 4px; padding-bottom: 4px; padding-right: 18px;">
<asp:TextBox ID="txt_mail" name="txt_mail" runat="server" reg="^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$" Width="200"></asp:TextBox>
<%--<input name="groupname" type="text" id="groupname" reg="^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$" tip="" /> --%>
<span name="easyTip">(邮箱地址,如wangking717@qq.com)</span>
</td>
</tr>
<tr bgcolor="#ffffff">
<td align="right" bgcolor="#EEEEEE" width="150px" style="padding-left: 5px; padding-top: 4px; padding-bottom: 4px; padding-right: 18px;">
网址 :
</td>
<td align="left" style="padding-left: 5px; padding-top: 4px; padding-bottom: 4px; padding-right: 18px;">
<asp:TextBox ID="txt_url" name="txt_url" runat="server" reg="^(http|https|ftp)\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(:[a-zA-Z0-9]*)?/?([a-zA-Z0-9\-\._\?\,\'/\\\+&%\$#\=~])*$" Width="200"></asp:TextBox>
<%--<input name="time1" type="text" id="time1" reg="^(http|https|ftp)\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(:[a-zA-Z0-9]*)?/?([a-zA-Z0-9\-\._\?\,\'/\\\+&%\$#\=~])*$" />--%>
<span name="easyTip">(URl格式,允许FTP,HTTP,HTTPS)</span>
</td>
</tr>
<tr bgcolor="#ffffff">
<td align="right" bgcolor="#EEEEEE" width="150px" style="padding-left: 5px; padding-top: 4px; padding-bottom: 4px; padding-right: 18px;">
图片上传 :
</td>
<td align="left" style="padding-left: 5px; padding-top: 4px; padding-bottom: 4px; padding-right: 18px;">
<input name="imgFile" type="file" id="imgFile" reg=".*gif|png$" /> <span name="easyTip">(允许GIF,PNG图片)</span>
</td>
</tr>
<tr bgcolor="#ffffff">
<td align="right" bgcolor="#EEEEEE" width="150px" style="padding-left: 5px; padding-top: 4px; padding-bottom: 4px; padding-right: 18px;">
来自哪里 :
</td>
<td align="left" style="padding-left: 5px; padding-top: 4px; padding-bottom: 4px; padding-right: 18px;">
<select id="from" name="from" reg="[^0]">
<option value="0">--请选择你来自哪里--</option>
<option value="a">北京</option>
<option value="b">上海</option>
<option value="c">四川</option>
</select> <span name="easyTip"></span>
</td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="2" align="left" style="padding-left: 5px; padding-top: 4px; padding-bottom: 4px; padding-right: 18px;">
<%--<input type="submit" name="submit" value=" 提交 " id="submit" />--%>
<asp:ImageButton ID="imgbt_save" runat="server" />
</td>
</tr>
</table>
</form>
</body>
</html>