后端修改密码的简单弹窗
2017-10-25 10:33
441 查看
后台的小伙,因为前端的功底不是很好,在做后台时,遇到一个修改的密码的弹窗不会弄,找到我,特意为其写了个demo
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style> #updataPwdBox{ width: 200px; height: 200px; border: 10px solid cadetblue; position: absolute; top: 50%; left: 50%; margin-left: -100px; margin-top: -100px; display: none; z-index: 99999999999; } #updataPwdBox .udataPwd{ margin-left:9px; margin-top: 10px; } .btnBox{ margin:10px auto; } .close{ margin-left: 10px; } .save{ margin-left: 76px; } </style> </head> <body> <div id="updata">点击修改密码</div> <div class="updataPwdBox" id="updataPwdBox"> <div class="udataPwd"> <table for-="username">用户名:</table><input type="text" id="username" /> </div> <div class="udataPwd"> <table for="oldpwd">旧密码:</table><input type="password" id='oldpwd'/> </div> <div class="udataPwd"> <table for="newpwd">新密码:</table><input type="password" id="newpwd"/> </div> <div class="btnBox"> <button class="close" id="close">取消</button> <button class="save" id="save">保存</button> </div> </div> <script> updata.onclick = function(){ updataPwdBox.style.display = "block"; } var close = document.getElementById('close'); var save = document.getElementById('save'); var username = document.getElementById('username'); var oldpwd = document.getElementById('oldpwd'); var newpwd = document.getElementById('newpwd'); close.onclick = function(e){ username.value=''; oldpwd.value=''; newpwd.value=''; updataPwdBox.style.display = 'none'; } //保存按钮触发事件 save.onclick = function(){ //获取用户名 var usernameval = username.value; console.log('用户名:'+usernameval); if(usernameval==''){ alert('用户名不能为空'); return false; } //获取旧密码 var oldpwdval = oldpwd.value; if(oldpwdval==''){ alert('旧密码不能为空'); return false; } //获取新密码 var newpwdval = newpwd.value; if(newpwdval==''){ alert('新密码不能为空'); return false; } console.log('旧密码:'+oldpwdval); console.log('新密码:'+newpwdval); } </script> </body> </html>
相关文章推荐
- Ubuntu修改密码长度太短或太简单解决
- 如何修改 winserver2008 密码策略为简单密码
- swift按钮如何添加弹窗事件进行修改昵称或者密码等内容
- php+mysql实现简单登录注册修改密码网页
- sql root账户密码忘记怎么办?最简单的sql语句修改方法
- Windows2008修改密码策略简单介绍
- 修改MySQL的root密码的简单方法
- 一种简单的修改所有域内本地管理员密码,及加某个帐号至本地管理员组的方法
- 逻辑复杂的业务代码如何实现有顺序的跳转展示(登录成功后要去摇奖,设置预留信息,修改密码,弹窗警告......等等)
- Windows7开机密码破解,简单步骤学会怎么修改Win7登录密码
- Ubuntu不能修改密码,长度太短或太简单?
- 【discuzx2】管理员密码的简单修改
- wampsever内置phpmyadmin密码修改和弹窗登陆
- 在前后端Exchange服务器上实现OWA修改密码
- 在16aspx.com上下了一个简单商品房销售系统源码,怎么修改它的默认登录名和密码
- linux忘记root密码最简单的修改方法
- 利用wampserver搭建简单环境时修改数据库密码
- mysql 5.7版本修改密码的简单方法
- 简单实现修改密码校验器
- linux fedora 24 root passwd 修改 用户 简单 密码