xuyan5971
BlogJava
首頁(yè)
新隨筆
聯(lián)系
聚合
管理
<
2009年10月
>
日
一
二
三
四
五
六
27
28
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
統(tǒng)計(jì)
隨筆 - 16
文章 - 0
評(píng)論 - 6
引用 - 0
常用鏈接
我的隨筆
我的評(píng)論
我的參與
最新評(píng)論
留言簿
給我留言
查看公開留言
查看私人留言
隨筆分類
Lucene(2)
(rss)
隨筆檔案
2009年10月 (3)
2009年9月 (2)
2009年8月 (4)
2009年6月 (6)
搜索
最新評(píng)論
1.?re: js 字符串的字符長(zhǎng)度。(用于驗(yàn)證input長(zhǎng)度,中文算兩個(gè)字符)
評(píng)論內(nèi)容較長(zhǎng),點(diǎn)擊標(biāo)題查看
--11111
2.?re: js 字符串的字符長(zhǎng)度。(用于驗(yàn)證input長(zhǎng)度,中文算兩個(gè)字符)[未登錄]
jhgfds
--hh
3.?re: js 字符串的字符長(zhǎng)度。(用于驗(yàn)證input長(zhǎng)度,中文算兩個(gè)字符)
不錯(cuò)
--sss
4.?re: js 字符串的字符長(zhǎng)度。(用于驗(yàn)證input長(zhǎng)度,中文算兩個(gè)字符)[未登錄]
</div>
--@
5.?re: js 字符串的字符長(zhǎng)度。(用于驗(yàn)證input長(zhǎng)度,中文算兩個(gè)字符)[未登錄]
評(píng)論內(nèi)容較長(zhǎng),點(diǎn)擊標(biāo)題查看
--@
閱讀排行榜
1.?js 字符串的字符長(zhǎng)度。(用于驗(yàn)證input長(zhǎng)度,中文算兩個(gè)字符)(4542)
2.?ajax回調(diào)函數(shù)調(diào)用多個(gè)參數(shù)。 循環(huán)調(diào)用。(1484)
3.?lucence_對(duì)文件建立索引(934)
4.?lucene_根據(jù)索引搜索文件(486)
5.?[jQuery]animate(滑塊滑動(dòng))(443)
評(píng)論排行榜
1.?js 字符串的字符長(zhǎng)度。(用于驗(yàn)證input長(zhǎng)度,中文算兩個(gè)字符)(6)
2.?動(dòng)態(tài)改變onclick 所調(diào)的函數(shù)。(0)
3.?jquery validation(0)
4.?[jQuery]animate(滑塊滑動(dòng))(0)
5.?jquery學(xué)習(xí)筆記(0)
jquery validation
1
<%
@page contentType
=
"
text/html; charset=GBK
"
%>
2
<%
@taglib uri
=
"
http://java.sun.com/jsp/jstl/core
"
prefix
=
"
c
"
%>
3
<%
@ taglib uri
=
"
http://java.sun.com/jsp/jstl/fmt
"
prefix
=
"
fmt
"
%>
4
<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
>
5
<
html
xmlns
="http://www.w3.org/1999/xhtml"
lang
="GBK"
xml:lang
="GBK"
>
6
<
head
>
7
<
meta
http-equiv
="Pragma"
content
="no-cache"
/>
8
<
meta
http-equiv
="Cache-Control"
content
="no-cache"
/>
9
<
meta
http-equiv
="Expires"
content
="0"
/>
10
<
link
type
="text/css"
title
="www"
rel
="stylesheet"
media
="all"
href
="<c:url value="
/theme/1/control/control.css"
/>
" />
11
<
title
>
jQuery之驗(yàn)證插件
</
title
>
12
<
style
type
='text/css'
>
13
*
{
}
{
font-family
:
Verdana
;
font-size
:
96%
;
}
14
label.error
{
}
{
float
:
none
;
color
:
red
;
padding-left
:
.5em
;
vertical-align
:
top
;
}
15
p
{
}
{
clear
:
both
;
}
16
.submit
{
}
{
margin-left
:
12em
;
}
17
em
{
}
{
font-weight
:
bold
;
vertical-align
:
top
;
}
18
</
style
>
19
<
script
type
='text/javascript'
src
='<c:url
value
="/js/jquery-1.3.2.js"
/>
'
>
</
script
>
20
<
script
type
='text/javascript'
src
='<c:url
value
="/js/jquery.validate.js"
/>
'
>
</
script
>
21
<
script
type
='text/javascript'
>
22
$(document).ready(
function
()
{
23
$('#commentForm').validate(
{
24
rules:
{
25
username:
{
26
required:
true
,
27
minlength:
1
,
28
formula:
"
7+9
"
29
}
,
30
email:
{
31
required:
true
,
32
email:
true
33
}
,
34
url:
"
url
"
,
35
comment:
"
required
"
,
36
coco:
{formula:
"
7+9
"
}
,
37
valcode:
{formula:
"
7+9
"
}
38
}
,
39
messages:
{
40
//
為name為email的控件的required()和email()驗(yàn)證方法設(shè)置驗(yàn)證失敗的消息內(nèi)容
41
email:
{required:
"
需要輸入電子郵箱
"
, email:
"
電子郵箱格式不正確
"
}
42
}
43
}
)
44
}
);
45
46
$.validator.addMethod(
47
"
formula
"
,
//
驗(yàn)證方法的名稱
48
function
(value,element,param)
{
//
驗(yàn)證規(guī)則
49
return
value
==
eval(param);
50
}
,
51
'請(qǐng)輸入正確的結(jié)果'
//
提示驗(yàn)證信息
52
);
53
</
script
>
54
</
head
>
55
56
<
body
>
57
<
form
class
='cmxform'
id
='commentForm'
method
='post'
action
='#'
>
58
<
fieldset
>
59
<
legend
>
一個(gè)簡(jiǎn)單的帶有提示的評(píng)論例子
</
legend
>
60
<
p
>
61
<
label
for
='cusername'
>
姓名
</
label
><
em
>
*
</
em
>
62
<
input
id
='cusername'
name
='username'
size
='25'
/>
63
</
p
>
64
<
p
>
65
<
label
for
='cemail'
>
電子郵件
</
label
><
em
>
*
</
em
>
66
<
input
id
='cemail'
name
='email'
size
='25'
/>
67
</
p
>
68
<
p
>
69
<
label
for
='curl'
>
網(wǎng)址
</
label
><
em
>
*
</
em
>
70
<
input
id
='curl'
name
='url'
size
='25'
value
=''
/>
71
</
p
>
72
<
p
>
73
<
label
for
='cverify'
>
7+9=
</
label
><
em
>
*
</
em
>
74
<
input
id
='cverify'
name
='coco'
size
='25'
value
=''
/>
75
</
p
>
76
<
p
>
77
<
label
for
='cvalcode'
>
驗(yàn)證碼
</
label
>
78
<
input
id
='cvalcode'
name
='valcode'
size
='25'
value
=''
/>
=7+9
79
</
p
>
80
<
p
>
81
<
label
for
='ccomment'
>
你的評(píng)論
</
label
><
em
>
*
</
em
>
82
<
textarea
id
='ccomment'
name
='comment'
cols
='25'
></
textarea
>
83
</
p
>
84
<
p
>
85
<
input
class
='submit'
type
='submit'
value
='提交'
>
86
</
p
>
87
</
fieldset
>
88
</
form
>
89
</
body
>
90
</
html
>
91
92
93
94
posted on 2009-10-15 13:37
R99
閱讀(407)
評(píng)論(0)
編輯
收藏
新用戶注冊(cè)
刷新評(píng)論列表
只有注冊(cè)用戶
登錄
后才能發(fā)表評(píng)論。
網(wǎng)站導(dǎo)航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
Powered by:
BlogJava
Copyright © R99
主站蜘蛛池模板:
理塘县
|
萝北县
|
峨眉山市
|
鲁甸县
|
望都县
|
电白县
|
平顺县
|
景洪市
|
万全县
|
明水县
|
聊城市
|
鹤山市
|
离岛区
|
武安市
|
宜阳县
|
广南县
|
麻栗坡县
|
乌拉特前旗
|
肃北
|
突泉县
|
双江
|
罗江县
|
廉江市
|
武夷山市
|
建平县
|
伊吾县
|
甘德县
|
济源市
|
三门县
|
涞源县
|
象州县
|
嵊泗县
|
油尖旺区
|
马关县
|
收藏
|
兴宁市
|
和静县
|
辽阳县
|
汕尾市
|
阳朔县
|
修文县
|