zoukankan
html css js c++ java
修改后的prototype.js,增加进度条和验证输入框
使用示例
<
script type
=
"
text/javascript
"
src
=
"
../scripts/prototype.js
"
></
script
>
<
script type
=
"
text/javascript
"
>
var progressBar;
/**/
/*
* 功能:admin登录
*/
function UserLogin()
{
//
验证页面控件
var checkform
=
new
CheckForm();
if
(
!
checkform.checkForm(document.getElementById(
'
formLogin
'
)))
return
false
;
//
开始提交数据
progressBar
=
new
ProgressBar();
progressBar.SetStatus(
"
正在发送数据到服务器
.
"
);
var url
=
"
../admin.do
"
;
var pars
=
"
action=Login&username=
"
+
$F(
'
username
'
)
+
"
&password=
"
+
$F(
'
password
'
)
+
"
&rnd=
"
+
$F(
'
rnd
'
);
var myAjax
=
new
Ajax.Request(
url,
{method:
'
post
'
, parameters: pars, onComplete: UserLogin_CallBack}
);
}
/**/
/*
* 功能:admin登录 - CallBack
*/
function UserLogin_CallBack(originalRequest)
{
var objXml
=
originalRequest.responseXML;
//
alert(originalRequest.responseTEXT);
try
{
if
(objXml.getElementsByTagName(
"
return
"
)[
0
].firstChild.nodeValue
==
"
true
"
)
{
progressBar.isNeedConfirmButton
=
false
;
progressBar.isNeedProgressBar
=
true
;
progressBar.SetStatus(
"
<img src='../images/error.gif' align='absmiddle'> 登录成功,正在载入,请稍候..
"
);
//
login success
location.href
=
'
admin_index.htm
'
;
}
else
{
progressBar.isNeedConfirmButton
=
true
;
progressBar.isNeedProgressBar
=
false
;
progressBar.focusItem
=
"
username
"
;
progressBar.SetStatus(
"
<img src='../images/error.gif' align='absmiddle'> 对不起,登录失败!
"
+
objXml.getElementsByTagName(
"
msg
"
)[
0
].firstChild.nodeValue);
$(
'
btnOK
'
).disabled
=
false
;
}
}
catch
(err)
{
progressBar.isNeedConfirmButton
=
true
;
progressBar.isNeedProgressBar
=
false
;
progressBar.focusItem
=
"
username
"
;
progressBar.SetStatus(
"
<img src='../images/error.gif' align='absmiddle'> 对不起,登录失败!
"
+
err.message);
$(
'
btnOK
'
).disabled
=
false
;
}
}
</
script
>
<
table width
=
"
100%
"
border
=
"
0
"
cellpadding
=
"
3
"
cellspacing
=
"
0
"
>
<
tr
>
<
td colspan
=
"
3
"
height
=
"
30
"
></
td
>
</
tr
>
<
tr
>
<
td width
=
"
21%
"
>
用户名:
</
td
>
<
td colspan
=
"
2
"
>
<
input type
=
"
text
"
tabindex
=
"
1
"
id
=
"
username
"
name
=
"
username
"
chname
=
"
用户名
"
notempty
=
"
true
"
size
=
"
20
"
style
=
"
180px;
"
/></
td
>
</
tr
>
<
tr
>
<
td
>
密 码:
</
td
>
<
td colspan
=
"
2
"
><
input type
=
"
password
"
tabindex
=
"
2
"
id
=
"
password
"
name
=
"
password
"
chname
=
"
密码
"
notempty
=
"
true
"
size
=
"
20
"
style
=
"
180px;
"
/></
td
>
</
tr
>
<
tr
>
<
td
>
验证码:
</
td
>
<
td colspan
=
"
2
"
>
<
input type
=
"
text
"
style
=
"
120px;
"
id
=
"
rnd
"
tabindex
=
"
3
"
chname
=
"
验证码
"
class
=
"
input_1
"
notempty
=
"
true
"
onKeyUp
=
"
value=value.replace(/[^\d]/g,'')
"
/>
<
img alt
=
"
验证码
"
src
=
"
../rnd.do?type=admin_rnd
"
border
=
"
0
"
usemap
=
"
absmiddle
"
/></
td
>
</
tr
>
<
tr
>
<
td
class
=
"
white
"
>&
nbsp;
</
td
>
<
td width
=
"
22%
"
><
input type
=
"
submit
"
Class
=
"
input_1
"
id
=
"
btnOK
"
value
=
"
登 录
"
tabindex
=
"
4
"
></
td
>
<
td width
=
"
57%
"
><
input type
=
"
reset
"
Class
=
"
input_1
"
value
=
"
重 置
"
></
td
>
</
tr
>
<
tr
>
<
td colspan
=
"
3
"
height
=
"
2
"
></
td
>
</
tr
>
<
tr
>
<
td colspan
=
"
3
"
></
td
>
</
tr
>
</
table
>
prototype.js下载
查看全文
相关阅读:
Webbrowser中模拟连接点击(非鼠标模拟)
用DDE控制Word
禁止用键盘左右箭头,去切换PageControl页签
Delphi实现全局鼠标钩子
Delphi实现软件中登录用户的操作权限
根据数据库结构生成TreeView
根据字符串找到函数并执行
用DLL实现插件的简单演示
Delphi:窗体的扩展样式GWL_EXSTYLE用于SetWindowLong
FastReport问题整理(http://129.sqdj.gov.cn/?p=77)
原文地址:https://www.cnblogs.com/yesun/p/408942.html
最新文章
《zw版·Halcon-delphi系列原创教程》 Halcon分类函数013,shape模型
《zw版·Halcon-delphi系列原创教程》 Halcon分类函数012,polygon,多边形
《zw版·Halcon-delphi系列原创教程》 Halcon分类函数011,ocr,字符识别
《zw版·Halcon-delphi系列原创教程》 Halcon分类函数010,obj,对象管理
《zw版·Halcon-delphi系列原创教程》 Halcon分类函数009,Measure,测量函数
《zw版·Halcon-delphi系列原创教程》 Halcon分类函数008,matrix,矩阵函数
《zw版·Halcon-delphi系列原创教程》 Halcon分类函数007, match,图像匹配
《zw版·Halcon-delphi系列原创教程》 Halcon分类函数006, image,影像处理(像素图)
《zw版·Halcon-delphi系列原创教程》 Halcon分类函数005·graphics-obj,基本绘图单元,包括线段、矩形、椭圆、圆形
全局键盘钩子(WH_KEYBOARD)
热门文章
实现软件自动升级
在Win32程序中显示Dos调试窗口
在窗体上创建自己的光标并输入文字
RTTI D7
delphi读取xml文件
窗体Form的FormStyle属性设置为fsStayOnTop时属性设置不起作用问题探讨。
windows的消息传递--消息盒子
实现拦截API的钩子(Hook)
取PE文件的引入表和导出表
KMP(字符串匹配)算法
Copyright © 2011-2022 走看看