您的位置:首页 > Web前端 > JavaScript

最简单的登录验证(js实现)

2009-05-05 14:46 736 查看

最简单的登录验证(js实现)

<%@ page contentType="text/html;charset=gb2312"%>

<html>

<head>

<title>发布管理系统</title>

<script type="text/javascript">

function checkchar(){

var pwd=document.getElementById('pwd').value;

if (isNaN(pwd)){ //判数字  非数字包括空

alert('请输入数字');

}else{

var passwd=parseInt(pwd);

if(passwd==111111){

location='deployment.htm';

//alert("songyc");

}

}

}

</script>

</head>

<body>

<table><td valign="top" height="75%">

<CENTER><h1>海虹发布列表</h1>

</CENTER><p><BR><BR>

<h2>validate what you input whether is correct</h2>

<form name="form2">

please input password:<input type="text" id="pwd" onkeyup="checkchar()" />

<input type="button" value="submit" />

</form><br /></p></td>

</table>

</body>

</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  input button function