<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script type="text/javascript" src="js/jquery-1.11.0.js" ></script>
<link rel="stylesheet" href="css/bootstrap.css" />
<style>
.login{
width: 500px;
border: 1px solid #ddd;
margin: 200px auto;
padding: 10px 15px;
border-radius: 4px;
}

</style>
</head>
<body>
<div class="login">
<h4 class="text-center text-muted">宿舍登录系统</h4>
<form>
<div class="form-group has-feedback">

<div class="input-group">
<div class="input-group-addon">
<i class="glyphicon glyphicon-user"></i>
</div>
<input class="form-control input" placeholder="请输入用户名" id="user"/>
<span class="glyphicon"></span>
</div>

</div>
<div class="form-group">
<div class="input-group">
<div class="input-group-addon">
<i class="glyphicon glyphicon-pencil"></i>
</div>
<input type="password" class="form-control input" placeholder="请输入密码" id="password" />
<span class="glyphicon"></span>
</div>
</div>
<div class="form-group">
<button class="btn btn-primary">登录</button>
<button class="btn btn-danger">注册</button>
</div>
</form>
</div>
<script>
$("#user").focus(function(){
$(this).parents(".form-group").addClass("has-warning")
})
$("#user").blur(function(){
var oUsername = $(this).val()
if(oUsername!="Asa"|| oUsername.length==0){
$(this).parents(".form-group").removeClass("has-success").addClass("has-error").find("span").addClass("glyphicon-remove form-control-feedback").removeClass("glyphicon-ok")
}else{
$(this).parents(".form-group").removeClass("has-error").removeClass("has-warning").addClass("has-success").find("span").removeClass("glyphicon-remove").addClass("glyphicon-ok form-control-feedback")
}

})

$("#password").focus(function(){
$(this).parents(".form-group").addClass("has-warning")
})
$("#password").blur(function(){
var oUsername = $(this).val()
if(oUsername!="666666"|| oUsername.length==0){
$(this).parents(".form-group").removeClass("has-success").addClass("has-error").find("span").addClass("glyphicon-remove form-control-feedback").removeClass("glyphicon-ok")

}else{
$(this).parents(".form-group").removeClass("has-error").removeClass("has-warning").addClass("has-success").find("span").removeClass("glyphicon-remove").addClass("glyphicon-ok form-control-feedback")
}

})

</script>

</body>
</html>

bootstrap2.2登录验证的更多相关文章

  1. ASP.NET MVC 登录验证

     好久没写随笔了,这段时间没 什么事情,领导 一直没安排任务,索性 一直在研究代码,说实在的,这个登录都 搞得我云里雾里的,所以这次我可能也讲得不是 特别清楚,但是 我尽力把我知道的讲出来,顺便也对自 ...

  2. Shiro安全框架入门篇(登录验证实例详解与源码)

    转载自http://blog.csdn.net/u013142781 一.Shiro框架简单介绍 Apache Shiro是Java的一个安全框架,旨在简化身份验证和授权.Shiro在JavaSE和J ...

  3. 练习:python 操作Mysql 实现登录验证 用户权限管理

    python 操作Mysql 实现登录验证 用户权限管理

  4. AD域登录验证

    AD域登录验证 作者:Grey 原文地址:http://www.cnblogs.com/greyzeng/p/5799699.html 需求 系统在登录的时候,需要根据用户名和密码验证连接域服务器进行 ...

  5. ASP.NET MVC4 Forms 登录验证

    Web.config配置: 在<system.web>节下: <authentication mode="Forms"> <forms loginUr ...

  6. MVC前台页面做登录验证

    最近接触了一个电商平台的前台页面,需要做一个登录验证,具体情况是:当用户想要看自己的订单.积分等等信息,就需要用户登录之后才能查询,那么在MVC项目中我们应该怎么做这个前台的验证呢? 1.我在Cont ...

  7. [MVC学习笔记]5.使用Controller来代替Filter完成登录验证(Session校验)

          之前的学习中,在对Session校验完成登录验证时,通常使用Filter来处理,方法类似与前文的错误日志过滤,即新建Filter类继承ActionFilterAttribute类,重写On ...

  8. ThinkPHP之登录验证

    验证方面写的不是很完整,正在完善当中 <?php /** * Created by dreamcms. * User: Administrator * Date: 2016/9/5 * Time ...

  9. ASP.NET MVC3 实现用户登录验证

    自定义一个授权筛选器类,继承于AuthorizeAttribute: using System; using System.Web; using System.Web.Mvc; namespace M ...

随机推荐

  1. PAT 1039 到底买不买(20)(20 分)

    1039 到底买不买(20)(20 分) 小红想买些珠子做一串自己喜欢的珠串.卖珠子的摊主有很多串五颜六色的珠串,但是不肯把任何一串拆散了卖.于是小红要你帮忙判断一下,某串珠子里是否包含了全部自己想要 ...

  2. iOS.Library.Architecture

    在用file查看library的architechture时有以下输出: $ file WebPWebP: Mach-O universal binary with 3 architecturesWe ...

  3. 探索未知种族之osg类生物---起源

    任何程序都是有生命的,是生命就需要呼吸.例如普通的windows程序,当运行完main()函数后,就需要进入消息循环,来监听用户的各种操作,以便做出及时的回应.这样的每次循环就像生命的每次呼吸,来维持 ...

  4. (转帖)CentOS最常用命令及快捷键整理

    原文:http://www.centoscn.com/CentOS/help/2014/0306/2493.html 最近开始学Linux,在VMware Player中安装了CentOS 6.4.为 ...

  5. php中static静态关键字的使用方法和应用场景

    php中除了常规类和方法的使用,访问控制之外,还有静态关键字static,静态变量可以是局部变量也可以是全局变量,当一个程序段执行完毕时,静态变量并没有消失,它依然存在于内存中,下次在定义时还是以前的 ...

  6. Python之路(第五篇) Python基本数据类型集合、格式化、函数

    一.变量总结 1.1 变量定义 记录某种状态或者数值,并用某个名称代表这个数值或状态. 1.2 变量在内存中的表现形式 Python 中一切皆为对象,数字是对象,列表是对象,函数也是对象,任何东西都是 ...

  7. 设置默认Browser

    电信A库要求android系统中有多个Browser时,开机自动设置一个默认浏览器,而不用弹出选择框让用户手动选择. 监听开机广播Intent.ACTION_BOOT_COMPLETED, 用Pack ...

  8. Oracle12c的卸载

    之前电脑装了Oracle12c 现在希望删除重新安装: 参照教程: http://jingyan.baidu.com/article/642c9d34e1cbdd644a46f7de.html E:\ ...

  9. having 的用法

    聚合函数 where 后面不能直接使用聚合函数 处理函数 题目 编写一个 SQL 查询,查找 Person 表中所有重复的电子邮箱. 示例: +----+---------+ | Id | Email ...

  10. viewer.js使用

    viewer GitHub 地址: JS 版本:https://github.com/fengyuanchen/viewerjs jQuery 版本:https://github.com/fengyu ...