runxinzhi.com
首页
百度搜索
.NET客户端的数据验证实例
Aapx代码块
<
form
id
="form1"
runat
="server"
>
<
asp:TextBox
ID
="TextBox1"
runat
="server"
></
asp:TextBox
>
<
asp:Button
ID
="Button7"
runat
="server"
OnClick
="Button7_Click"
OnClientClick
="javascript:return checkForm()"
Text
="提交"
/>
</
form
>
JavaScript代码块
<
script language
=
"
javascript
"
type
=
"
text/javascript
"
>
function checkForm()
{
if
(document.form1.TextBox1.value
==
""
)
{
alert(
"
怎么是空的!
"
);
document.form1.TextBox1.focus();
return
false
;
}
var length
=
document.form1.TextBox1.value.length;
if
(length
<
6
||
length
>
10
)
{
alert(
"
必须是6~10个字符内!
"
);
return
false
;
}
}
</
script
>
相关阅读:
Codeforces 837F Prefix Sums
Codeforces 822E Liar dp + SA (看题解)
Codeforces 989D A Shade of Moonlight
Codeforces 887D Ratings and Reality Shows
Codeforces 666E E
Codeforces 436E Cardboard Box (看题解)
Codeforces 342D Xenia and Dominoes 状压dp
js倒计时
$.extends 继承原理
js点击回到顶部2
原文地址:https://www.cnblogs.com/kingfly/p/1567773.html
最新文章
POJ 2528 Mayor’s posters (线段树段替换 && 离散化)
SPOJ D-query && HDU 3333 Turing Tree (线段树 && 区间不相同数个数or和 && 离线处理)
UVa 122 Trees on the level (动态建树 && 层序遍历二叉树)
UVa 1602 Lattice Animals (STL && 生成n连块 && 无方向形状判重)
UVa 1343 The Rotation Game (状态空间搜索 && IDA*)
UVa 11212 Editing a Book (IDA* && 状态空间搜索)
UVa 10603 Fill (BFS && 经典模拟倒水 && 隐式图)
[USACO07JAN]平衡的阵容Balanced Lineup BZOJ 1699
【模板】最近公共祖先(LCA)
[国家集训队]happiness 最小割 BZOJ 2127
热门文章
[USACO08MAR]跨河River Crossing dp
【模板】网络最大流
[USACO08NOV]安慰奶牛Cheering up the Cow BZOJ 1232 Kruskal
酒店之王 最大流
[USACO06NOV]糟糕的一天Bad Hair Day BZOJ 1660 单调栈
[ZJOI2009]假期的宿舍 BZOJ 1433 二分图匹配
[BOI2007]Sequence 序列问题 BZOJ1345
Codeforces 354B dp Game with Strings dp
Codeforces 425E Sereja and Sets dp
Codeforces 1076F Summer Practice Report dp
Copyright © 2020-2023
润新知