javascript使用者登入使用者名稱密碼驗證

來源:互聯網
上載者:User
提示:您可以先修改部分代碼再運行

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title></title><style type="text/css"><!--#login{width:420px;height:200px;background-image:url(pic/login.gif);background-repeat:no-repeat;font-size:12px;margin:0px auto;margin-top:150px;padding-top:55px;padding-left:30px;}.input{width:130px;height:18px;border:1px solid #003300;}.input1{height:16px; width:40px;border:1px solid #003300;}.input2{height:25;width:65px;}p{line-height:40px;margin-top:2px;height:100%;}--></style><script language="javascript"><!--function check(){var username=document.getElementById('username').value;var password=document.getElementById('password').value;var ver=document.getElementById('ver').value;if(!username.match(/^w{3,12}/) || username.length>15){alert('使用者名稱由3-12個字元組成!');form1.username.select();return false;}if(!password.match(/^w{6,10}/) || password.length>15 ){alert('密碼由6-10個字元組成!');form1.password.select();return false;}if(!ver.match(/^d{4}/)){alert('驗證碼必須由4位元字組成!');form1.ver.select();return false;}}--></script></head><body> <form name="form1" method="post" action="login.php"><div id="login"> <table width="85%" border="0"> <tr> <td width="24%" height="25" align="right">管理帳號:</td> <td colspan="2"><input name="username" type="text" class="input" id="username"></td> <td width="22%"></td> </tr> <tr> <td height="25" align="right">密碼:</td> <td colspan="2"><input name="password" type="password" class="input" id="password"></td> <td> </td> </tr> <tr> <td height="25" align="right">驗證碼:</td> <td width="14%"><input name="ver" type="text" class="input1" id="ver" size="5"></td> <td width="40%"></td> <td></td> </tr> <tr> <td height="25">  </td> <td colspan="2"><input name="Submit" type="submit" class="input2" onclick="javascript:return check();window.close();" value="登 錄" target="_parent" > <input name="Submit" type="reset" class="input2" value="清 除"></td> <td> </td> </tr> </table> </div> </form></body></html></td> </tr></table>
提示:您可以先修改部分代碼再運行

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.