今天继续复习了上学期的内容
主要复习了web
以下是修改的代码
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2 <html> 3 <head> 4 <%@ page language="java" contentType="text/html; charset=UTF-8" 5 pageEncoding="UTF-8"%> 6 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 7 <title>河北创新技术平台</title> 8 <script type="text/javascript" src="js/jquery-3.1.1.min.js"></script> 9 <script type="text/javascript"> 10 var swit = 0; 11 $(document).ready(function(){ 12 var error = "${regerror}"; 13 if(error!=null&&error!=""){ 14 $("#reg").css({background:'#2288bb'}); 15 $("#log").css({background:'#3399cc'}); 16 $(".login").hide(); 17 $(".reg").show(); 18 $("#tip6").html(error); 19 swit = 1; 20 } 21 22 $(".inputid").blur(function(){ 23 var id = $(".inputid").val(); 24 if(id==''){ 25 $('#tip1').html('平台编号不能为空!'); 26 }else{ 27 $('#tip1').html(''); 28 } 29 }); 30 $(".inputpass").blur(function(){ 31 var password = $(".inputpass").val(); 32 if(password==''){ 33 $('#tip2').html('登陆密码不能为空!'); 34 }else{ 35 $('#tip2').html(''); 36 } 37 }); 38 $("#log").click(function(){ 39 if(swit==1){ 40 swit = 0; 41 $("#log").css({background:'#2288bb'}); 42 $("#reg").css({background:'#3399cc'}); 43 $(".login").show(); 44 $(".reg").hide(); 45 } 46 }); 47 $(".clickR").click(function(){ 48 $("#reg").css({background:'#2288bb'}); 49 $("#log").css({background:'#3399cc'}); 50 $(".login").hide(); 51 $(".reg").show(); 52 swit = 1; 53 }); 54 $("#reg").click(function(){ 55 if(swit==0){ 56 swit = 1; 57 $("#reg").css({background:'#2288bb'}); 58 $("#log").css({background:'#3399cc'}); 59 $(".login").hide(); 60 $(".reg").show(); 61 } 62 }); 63 $("input[name='name']").blur(function(){ 64 var name = $("input[name='name']").val(); 65 if(name=='')$("#tip3").html('平台名称不能为空!'); 66 else $("#tip3").html(''); 67 }); 68 $("input[name='id1']").blur(function(){ 69 var id = $("input[name='id1']").val(); 70 if(id=='')$("#tip4").html('平台编号不能为空!'); 71 else $("#tip4").html(''); 72 }); 73 $("input[name='kind']").blur(function(){ 74 if(!$("input[name='kind']").is(":checked"))$("#tip5").html('请选择平台类型!'); 75 else $("#tip5").html(''); 76 }); 77 $("input[name='pass']").blur(function(){ 78 var id = $("input[name='pass']").val(); 79 if(id=='')$("#tip6").html('登陆密码不能为空!'); 80 else $("#tip6").html(''); 81 }); 82 $("input[name='checkpass']").blur(function(){ 83 var id = $("input[name='checkpass']").val(); 84 if(id=='')$("#tip6").html('登陆密码不能为空!'); 85 else $("#tip6").html(''); 86 }); 87 //提交时要验证:1.信息是否填写 2.信息是否按照信息正确填写 88 $("input[value='登 陆']").click(function(){ 89 var flag = 1; 90 var id = $(".inputid").val(); 91 var pass = $(".inputpass").val(); 92 if(id==''){ 93 $('#tip1').html('平台编号不能为空!'); 94 flag = 0; 95 } 96 if(pass==''){ 97 $('#tip2').html('登陆密码不能为空!'); 98 flag = 0; 99 } 100 if(flag==0)return false; 101 if(flag==1)$("form[action='login']").submit(); 102 //记得后期还要加入信息的正确格式 103 }); 104 $("input[value='确 认 注 册']").click(function(){ 105 var flag = 1; 106 var name = $("input[name='name']").val(); 107 var id = $("input[name='id1']").val(); 108 var pass = $("input[name='pass']").val(); 109 var checkpass = $("input[name='checkpass']").val(); 110 if(name==''){ 111 $("#tip3").html('平台名称不能为空!'); 112 flag = 0; 113 } 114 if(id==''){ 115 $("#tip4").html('平台编号不能为空!'); 116 flag = 0; 117 } 118 if(id.length!=10){ 119 $("#tip4").html('平台编号共10位!'); 120 flag = 0; 121 } 122 if(id!=''&&id.indexOf("GA")!=0){ 123 $("#tip4").html('平台编号是以GA开头的!'); 124 flag = 0; 125 } 126 if(!$("input[name='kind']").is(":checked")){ 127 $("#tip5").html('请选择平台类型!'); 128 flag = 0; 129 } 130 if(pass==''||checkpass==''){ 131 $("#tip6").html('登陆密码不能为空!'); 132 flag = 0; 133 } 134 if($.trim(pass)!=$.trim(checkpass)){ 135 $("#tip6").html('前后密码不一致!'); 136 flag = 0; 137 }if(pass.length!=8||checkpass.length!=8){ 138 $("#tip6").html('密码为8位!'); 139 flag = 0; 140 } 141 if(flag==0)return false; 142 if(flag==1)$("form[action='reg']").submit(); 143 }); 144 }) 145 </script> 146 <script type="text/javascript"> 147 $(function(){ 148 149 }); 150 </script> 151 <style type="text/css"> 152 body{ 153 154 background:url(img/banner.jpg); 155 background-position: center; 156 background-repeat: no-repeat; 157 background-attachment: fixed; 158 } 159 .swit{ 160 120px; 161 height:30px; 162 margin:0 auto; 163 margin-top:2%; 164 margin-bottom:0; 165 } 166 .button{ 167 background:#3399cc; 168 padding:10px; 169 text-align:center; 170 margin:-2px; 171 text-decoration:none; 172 font-family:微软雅黑; 173 color:#fff; 174 cursor:pointer; 175 } 176 .button:hover{ 177 background:#2288bb; 178 } 179 #log{ 180 background:#2288bb; 181 } 182 .triangle{ 183 0; 184 border-top:12x solid transparent; 185 border-right:12px solid transparent; 186 border-bottom:12px solid #3399cc; 187 border-left:12px solid transparent; 188 margin:0 auto; 189 } 190 .login{ 191 300px; 192 margin:0 auto; 193 } 194 .tit{ 195 background:#3399cc; 196 padding:15px 0; 197 text-align:center; 198 color:#fff; 199 font-size:30px; 200 font-weight:bold; 201 font-family:微软雅黑; 202 margin:0; 203 } 204 form[action='login']{ 205 background:#fff; 206 padding:10px; 207 border:1px solid #3399cc; 208 } 209 .ii{ 210 90%; 211 margin:5px auto; 212 } 213 .inputid{ 214 100%; 215 height:35px; 216 font-size:80%; 217 padding-left:40px; 218 background:url(img/user.jpg) no-repeat; 219 background-position:left; 220 border:1px solid gray; 221 } 222 .inputpass{ 223 100%; 224 height:35px; 225 font-size:80%; 226 padding-left:40px; 227 background:url(img/key.jpg) no-repeat; 228 background-position:left; 229 border:1px solid gray; 230 } 231 .tip{ 232 color:red; 233 height:12px; 234 font-size:12px; 235 font-family:微软雅黑; 236 margin-left:18px; 237 margin-top:0; 238 margin-bottom:10px; 239 padding:0; 240 } 241 .tip1{ 242 color:red; 243 height:12px; 244 font-size:12px; 245 font-family:微软雅黑; 246 margin-left:72px; 247 margin-top:0; 248 margin-bottom:10px; 249 padding:0; 250 } 251 input[type='submit']{ 252 90%; 253 margin:10px auto; 254 margin-left:15px; 255 margin-top:0; 256 background:#3399cc; 257 border:0; 258 padding:4%; 259 font-size:100%; 260 color:#fff; 261 cursor:pointer; 262 } 263 input[type='submit']:hover{ 264 background:#2288bb; 265 } 266 input[type='checkbox']{ 267 margin-left:15px; 268 margin-top:0; 269 margin-bottom:10px; 270 font-size:10px; 271 font-family:微软雅黑; 272 } 273 .rr{ 274 margin-top:0; 275 margin-right:15px; 276 font-size:15px; 277 float:right; 278 font-family:微软雅黑; 279 } 280 a:visited,a:hover,a:link,a:active{ 281 color:#2288bb; 282 text-decoration:none; 283 font-family:微软雅黑; 284 } 285 .reg{ 286 300px; 287 margin:0 auto; 288 display:none; 289 } 290 table{ 291 margin:0 auto; 292 font-family:微软雅黑; 293 color:gray; 294 } 295 form[action='reg']{ 296 background:#fff; 297 padding:5px; 298 border:1px solid #3399cc; 299 } 300 .ft{ 301 100%; 302 height:150px; 303 border:none; 304 margin-bottom:10px; 305 } 306 </style> 307 </head> 308 <body> 309 <div style="535px;margin:0 auto;margin-top:30px;"> 310 <img src="img/kjt_logo.png" style="display:block;margin:0 auto 20px auto;"/> 311 <img src="img/kouhao3.png" style="margin:20px auto 30px auto;"/> 312 </div> 313 <div class="swit"> 314 <span class="button" id="log" href="#">登 陆</span> 315 <span class="button" id="reg" href="#">注 册</span> 316 </div> 317 <div class="login"> 318 <div class="triangle"></div> 319 <h1 class="tit">平 台 登 陆</h1> 320 <form action="login" method="post"> 321 <div class="ii"><input type="text" class="inputid" name="id" placeholder="平台编号" value="${pid}"/></div> 322 <p id="tip1" class="tip"></p> 323 <div class="ii"><input type="password" class="inputpass" name="password" placeholder="登陆密码" /></div> 324 <p id="tip2" class="tip">${error}</p> 325 <input type="checkbox" name="mememory" value="1" />记住账号<p class="rr">没注册?<span class="clickR" style="color:#2288bb;">去注册</span></p> 326 <input type="submit" value="登 陆" /> 327 </form> 328 </div> 329 <div class="reg"> 330 <div class="triangle"></div> 331 <h1 class="tit">平 台 注 册</h1> 332 <form action="reg" method="post"> 333 <table> 334 <tr><td>平台名称: <input type="text" name="name" /><br/> 335 <p class="tip1" id="tip3"></p> 336 </td></tr> 337 <tr><td>平台编号: <input type="text" name="id1" /><br/> 338 <p class="tip1" id="tip4"></p></td></tr> 339 <tr><td>平台类型: <input type="radio" name="kind" value="重点实验室" checked/>重点实验室<br/> 340 341 <input type="radio" name="kind" value="工程技术研究中心" />工程技术研究中心<br/> 342 343 <input type="radio" name="kind" value="产业技术研究院" />产业技术研究院<br/> 344 <p class="tip1" id="tip5"></p></td></tr> 345 <tr><td>登陆密码: <input type="password" name="pass" /></td></tr> 346 <tr><td>确认密码: <input type="password" name="checkpass" /><br/> 347 <p class="tip1" id="tip6">请设置8位密码</p></td></tr> 348 <tr><td><input type="submit" value="确 认 注 册" /></td></tr> 349 </table> 350 </form> 351 </div> 352 <iframe src="foot.jsp" class="ft" scrolling="no"></iframe> 353 </body> 354 </html>
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2 <html> 3 <head> 4 <%@ page language="java" contentType="text/html; charset=UTF-8" 5 pageEncoding="UTF-8"%> 6 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 7 <title>平台用户操作界面</title> 8 </head> 9 <frameset rows="70,*" cols="*" frameborder="no" border="0" framespacing="0" bordercolor="#B1D8EA"> 10 <frame src="head.jsp" name="topFrame" frameborder="no" scrolling="no" id="topFrame" title="topFrame"/> 11 <frameset name="myFrame" cols="220,*" frameborder="no" border="0" framespacing="0"> 12 <frame src="left.jsp" name="leftFrame" style="padding-left: 0px; padding-top: 0px;" frameborder="no" scrolling="no" noresize="noresize" id="leftFrame" title="leftFrame" /> 13 <frameset name="myFrame" rows="40,*" frameborder="no" border="0" framespacing="0"> 14 <frame src="navi2.jsp" name="navFrame" id="navFrame" scrolling="no" title="manFrame" /> 15 <frame src="help.jsp" name="mainAction" frameborder="no" id="manFrame" style="padding-left:1px" style="background:#B1D8EA;" title="manFrame" /> 16 </frameset> 17 </frameset> 18 </frameset> 19 <body></body> 20 </html>
1 <%@ page language="java" contentType="text/html; charset=UTF-8" 2 pageEncoding="UTF-8"%> 3 <!DOCTYPE html> 4 <html> 5 <head> 6 <meta charset="UTF-8"> 7 <title></title> 8 <link rel="stylesheet" type="text/css" href="css/login.css"/> 9 <script src="js/jquery-1.9.1.min.js" type="text/javascript" charset="utf-8"></script> 10 </head> 11 <body> 12 <div class="login"> 13 <div class="content clearfix"> 14 <div class="content-left"> 15 <div class="logo"> 16 17 <p>创新年报平台管理系统</p> 18 </div> 19 </div> 20 <div class="shu"></div> 21 <form action="login" method="post"> 22 <div class="content-right"> 23 <div class="login-form"> 24 <h2>用户登录/LOGIN</h2> 25 26 <div class="account clearfix"> 27 <span>账 号:</span> 28 <input type="text" value="" name="id"/> 29 </div> 30 <div class="password clearfix"> 31 <span>密 码:</span> 32 <input type="password" value="" name="password"/> 33 </div> 34 35 36 <span id="login" style="50px"><input style="50px" type="submit" value="登录" class="btn" /></span> 37 <span class="forget" style="50px"><input style="50px" type="submit" value="注册" class="btn"/></span> 38 39 </div> 40 41 </div> 42 </form> 43 </div> 44 </div> 45 <script type="text/javascript"> 46 47 48 </script> 49 <!--<script type="text/javascript"> 50 $(document).ready(function(){ 51 if (window.PIE) { 52 $('.rounded').each(function() { 53 PIE.attach(this); 54 }); 55 } 56 }); 57 </script>--> 58 </body> 59 </html>