jquery 表单验证

比较好用的验证插件

 

 

<!DOCTYPE html>
<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title></title>
<meta content='text/html;charset=UTF-8' http-equiv='Content-Type' />
<script src="jquery.js" type="text/javascript"></script>
<script src="vanadium.js" type="text/javascript"></script>
</head>
<body>

<form method="get" action="submit_example_form.html">
	<fieldset>
		<legend>Example of form validation</legend>
		<p>Presence <input class=":required" type="text"></p>
		<p>Format <input class=":format;/^(vanadium)+$/i" type="text"></p>
		<p>Ajax - using server-side to do the job! <input id="pass" class=":ajax;/username_checker/check.json" type="text"></p>
		<p>Integer <input class=":integer" type="text"></p>
		<p>Float <input class=":float" type="text"></p>
		<p>Length <input class=":length;4" type="text"></p>
		<p>Longer than or equal to a minimum length <input class=":min_length;4" type="text"></p>
		<p>Shorter than or equal to a maximum length <input class=":max_length;4" type="text"></p>
		<p>Within a range of lengths <input class=":min_length;4 :max_length;8" type="text"></p>
		<p>Acceptance <input class=":accept" type="checkbox"></p>
		<p>Confirmation <input id="pass" class=":required" type="password"></p>
		<p> <input class=":same_as;pass" type="password"></p>
		<p>Email address <input id="pass" class=":email" type="text"></p>
		<p>When losing focus. <input class=":required :only_on_blur" type="text"></p>
		<p>Delayed validation. <input class=":required :wait;1500" type="text"></p>
		<p>When submitting the form. <input class=":required :only_on_submit" type="text"></p>
		<p>Immediate validation (default one).  <input class=":required" type="text"></p>
		<p>select <select name="select-marca" class=":required">
    <option selected="selected" value="">- Seleccionar -</option>
    <option value="ALFA ROMEO">ALFA ROMEO</option>
    <option value="ARO">ARO</option>
    <option value="ASIA">ASIA</option>
  </select></p>
		<p></p>
		<p></p>

		<p><label for="email">Email (required):</label><input style="width: 200px" type="text" class=":email :required"/></p>
		<p><label for="accept">Acceptance (required):</label><input type="checkbox" class="checkbox :accept"/></p>
		<p><label for="desc">Presence (required):</label><textarea style="width: 200px" cols="10" rows="2" class="shallow :required"></textarea></p>
		<p><input type="submit" value="Test me!" class="submit"/></p>

    </fieldset>
</form>
     
</body>
</html>

valid_class: 'rightformcss',//验证正确时表单样式
invalid_class: 'failformcss',//验证失败时该表单样式
message_value_class: 'msgvaluecss',//这个样式是弹出信息中调用值的样式
advice_class: 'failmsg',//验证失败时文字信息的样式
 

 

 

原文: http://www.vanadiumjs.com/?

 

 

 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值