Javascript验证练习。请求师兄修改bug 。出错时候为什么不能显示 “确定”按钮??
来源:互联网 发布:阿拉伯语自学软件 编辑:程序博客网 时间:2024/04/29 21:59
<!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>
<title>无标题页</title>
<style type="text/css">
div {width:200;height:40;color:red}
</style>
<script type="text/javascript">
function login()
{
wrong.style.display = "block";
var sst=new person(txt_name.value ,txt_paswd.value );
if(""==txt_name.value||""==txt_paswd.value )
{
wrong.innerHTML = "请输入完整的信息";
}
else
{
if(txt_name.value !="a" && txt_paswd.value !="a")
{
wrong.innerHTML="请输入正确信息";
}
else
{
sst.show();
wrong.style.display = "none";
}
}
}
// function ckpas()
// {
//
// if(txt_paswd.value =='')
// alert("mima bu neng wei kong ");
// document.getElementById ("txt_paswd")="";
// document.getElementById ("txt_paswd").focus();
//
//
// }
function person(name,paswd)
{
this.name=name
this.paswd=paswd;
this.show=function(){
alert("恭喜您输入正确"+"/n姓名:"+this.name);
}
}
function clearn()
{
txt_name.value="";
txt_paswd.value="";
}
</script>
</head>
<body>
<div id ="wrong" style="text-align: center">
<table style="width: 300pt; height: 74pt">
<tr>
<td style="width: 100px; height: 26px">
用户名</td>
<td style="width: 100px; height: 26px">
<input id="txt_name" name="name" type="text" /></td>
</tr>
<tr>
<td style="width: 100px; height: 28px">
密码</td>
<td style="width: 100px; height: 28px">
<input id="txt_paswd" name="paswd" style="width: 149px" type="password" /></td>
</tr>
<tr>
<td colspan="2">
<input id="Reset1" style="left: 94px; position: relative; top: 0px" type="reset"
value="重置" onclick = "clearn();" />
<input id="Button1" style="left: -11px; position: relative; top: 0px" type="button"
value="登陆" onclick = "login();" />
</td>
</tr>
<tr>
<td colspan="2" style="height: 22px">
</td>
</tr>
</table>
</div>
</body>
</html>
- Javascript验证练习。请求师兄修改bug 。出错时候为什么不能显示 “确定”按钮??
- 为什么有些时候我们请求验证码会用跨域请求
- eWebEditor弹出窗口不能完整显示确定按钮问题
- eWebEditor弹出窗口不能完整显示确定按钮问题
- [ASP.NET]为什么CustomValidator验证控件在验证DropdownList的时候不能设置ControlToValidate属性
- JavaScript练习题目(3)点击按钮显示确认对话框
- 使用jquery Validate的时候验证出错的提示显示位置问题
- 定义的按钮类继承CBUTTON类修改光标显示时不能够正常的修改
- 验证码不能显示
- 为什么用tortoisegit 打开log的时候会显示未修改的文件
- 调用函数的时候不能禁用按钮
- 为什么常量指针不能修改
- 为什么使用spinlock的时候不能睡眠
- javascript 密码修改验证
- 为什么有时不能显示“摘要”?
- webkit为什么不能显示中文
- d3d为什么不能显示正反面
- Spring Microservices in Action-Manning(2017) 读书笔记(```里的xml为什么不能显示为缩进?Markdown的bug??)
- POJ2386 Lake Counting
- DBhelper有些不懂,请各位指教
- 根文件系统制作 busybox移植
- INSERT INTO 语句 中的 引号问题
- 解析动态联编
- Javascript验证练习。请求师兄修改bug 。出错时候为什么不能显示 “确定”按钮??
- Firefox下拖拽客户端文件到浏览器达到上传效果的实现(java例)
- js屏蔽按键
- 2010年4月1日愚人节弄的Oracle数据库问题!以及其他的思想
- STM32F103--(一) 硬件部分的思考
- Oracle中几张重要的表
- SPFA算法
- 网店增加浏览量
- Java反编译工具Jad大集合