学习随记

学习笔记

我组在这周内尝试了使用php做网页登陆页面的简易代码,具体代码如下。

<html>

<head>

<metacharset="UTF-8">

<title>登录页面</title>

<style>

#registForm{

width: 500px;

height: 140px;

 border: 1px solid #666;

margin: auto;

margin-top: 30px;

padding-left: 20px;

border-radius: 5px;

box-shadow: 10px 5px 5px#eee;

 

  }

.lab1{

}

input[type=text]{

margin-left: 10px;

border: 1px dotted #a7c942;

border-radius: 5px;

  box-shadow: 2px 3px 4px #666;

color: #666;

font-size: 14px;

font-weight: bold;

text-indent: 8px;

width:200px;

}

input[type=password]{

 margin-left: 10px;

margin-left: 10px;

border: 1px dotted#a7c942;

border-radius: 5px;

box-shadow: 2px 3px 4px#666;

  width:200px;

}

input[name=btn_submit]{

margin-left: 60px;

}

input[name=btn_reset]{

margin-left: 20px;

}

.btn{

background-color: green;

color: #fff;

border: 1px solid red;

border-radius: 5px;

}

.tip1,  .tip2{

color: red;

}

</style>

</head>

<body>

<?php

// put your code here

?>

<formmethod="post" id="registForm"action="">

<p>

<labelfor="userName">用户名</label>

<inputtype="text"name="userName" id="userName">

<spanclass="tip1">*</span>

</p>

<p>

<labelfor="userPass">密 码</label>

<inputtype="password"name="userPass" id="userPass">

<spanclass="tip2">*</span>

</p>

 <p>

 <inputtype="submit"name="btn_submit"  value="登录"class="btn">

<inputtype="reset"name="btn_reset"  value="登出"class="btn">

 

</p>

</form>

 

</body>

<scriptsrc="jquery.js"></script>

<script>

$(function () {

$("#userName").blur(function() {

// alert("haha");

var len=$("#userName").val().length;

//alert(len);

if (len < 5) {

$(".tip1").html("请至少5位以上。");

$(".tip1").css("color","red");

} else

{

$(".tip1").html("√");

$(".tip1").css("color","green");

}

});

$("#userPass").blur(function() {

// alert("haha");

var len =$("#userPass").val().length;

//alert(len);

if (len < 5) {

$(".tip2").html("请至少3位以上。");

$(".tip2").css("color","red");

} else

 {

$(".tip2").html("√");

 $(".tip2").css("color","green");

 }

});

});

   </script>

</html>


蔡贵城,谢讯组,

017,11,24

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值