Browse Source

用户首次注册完善信息页面。

zzy.zhiyuan.foxmail 8 years ago
parent
commit
d0c2678aba
2 changed files with 41 additions and 41 deletions
  1. 8 8
      src/main/webapp/information-add.html
  2. 33 33
      src/main/webapp/js/information-add.js

+ 8 - 8
src/main/webapp/information-add.html

@ -13,7 +13,7 @@
13 13
<link type="text/css" href="css/login.css" rel="stylesheet">
14 14
<link type="text/css" href="css/common.css" rel="stylesheet">
15 15
<script type="text/javascript" src="js/jquery-1.11.1.js"></script>
16
<script type="text/javascript" src="js/information-add.js"></script>
16

17 17
</head>
18 18

19 19
<body>
@ -31,27 +31,27 @@
31 31
            	<table>
32 32
                	<tr>
33 33
                    	<td><div class="basictype">姓名</div></td>
34
                        <td><div class="basiccon"><input type="text" class="inputtxt" name="name"id="name"><span class="requiredcon">*</span></div></td>
34
                        <td><div class="basiccon"><input type="text" class="inputtxt" id="name"><span class="requiredcon">*</span></div></td>
35 35
                    </tr>
36 36
                    
37 37
                    <tr class="basicmsgbox"><th></th><td><div class="basiccon"><div class="basicmsg basicmsg1"></div></div></td></tr>   
38 38
                    <tr>
39 39
                    	<td><div class="basictype">机构</div></td>
40
                        <td><div class="basiccon"><input type="text" class="inputtxt" name="org"id="org"><span class="requiredcon">*</span></div></td>
40
                        <td><div class="basiccon"><input type="text" class="inputtxt" id="orgName"><span class="requiredcon">*</span></div></td>
41 41
                    </tr>
42 42
                   
43 43
                     <tr class="basicmsgbox"><th></th><td><div class="basiccon"><div class="basicmsg basicmsg2"></div></div></td></tr>   
44 44
                    <tr>
45 45
                    	<td><div class="basictype">部门</div></td>
46
                        <td><div class="basiccon"><input type="text" class="inputtxt" name="depart"id="orgName"></div></td>
46
                        <td><div class="basiccon"><input type="text" class="inputtxt" id="department"></div></td>
47 47
                    </tr>
48 48
                    <tr>
49 49
                    	<td><div class="basictype">职称</div></td>
50
                        <td><div class="basiccon"><input type="text" class="inputtxt" name="ptit"id="title"></div></td>
50
                        <td><div class="basiccon"><input type="text" class="inputtxt" id="title"></div></td>
51 51
                    </tr>
52 52
                     <tr>
53
                    	<td><div class="basictype">职位</div></td>
54
                        <td><div class="basiccon"><input type="text" class="inputtxt" name="post"id="department"></div></td>
53
                    	<td><div class="basictype">地址</div></td>
54
                        <td><div class="basiccon"><input type="text" class="inputtxt" id="address"></div></td>
55 55
                    </tr>
56 56
                    
57 57
                    <tr>
@ -95,6 +95,6 @@
95 95
	</div>
96 96
	<div class="footer-btm">本站由 阿里云 提供计算与安全服务 Copyright © 2016~2017 科袖 | 京ICP备12345678号 | 京ICP证123456号 | 京公网安备11010800011111号 | 网站联盟安全认证</div>
97 97
</div>
98

98
<script type="text/javascript" src="js/information-add.js"></script>
99 99
</body>
100 100
</html>

+ 33 - 33
src/main/webapp/js/information-add.js

@ -1,19 +1,19 @@
1
function GetQueryString(name) { 
1
function GetQueryString(name)
2
{ 
2 3
		var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); 	
3
		var r = window.location.search.substr(1).match(reg);  //��ȡurl��"?"�����ַ�����ƥ��
4
	
4
		var r = window.location.search.substr(1).match(reg);  
5 5
		var context = ""; 
6 6
		if (r != null) 
7 7
			 context = r[2]; 
8 8
		reg = null; 
9 9
		r = null; 
10 10
		return context == null || context == "" || context == "undefined" ? "" : decodeURI(context); 
11
	}
11
}
12 12
var id=GetQueryString("id");
13 13
var namePass=false;
14 14
var orgPass=false;
15 15
$("#name").blur(function(){
16
	var name=$("#name").val;
16
	var name=$("#name").val();
17 17
	if(name.length==0 && name==""){
18 18
		$(".basicmsg1").text("请输入您的姓名");
19 19
	}else{
@ -21,8 +21,8 @@ $("#name").blur(function(){
21 21
		 namePass=true;
22 22
	}
23 23
});
24
$("#org").blur(function(){
25
	var org=$("#name").val;
24
$("#orgName").blur(function(){
25
	var org=$("#orgName").val();
26 26
	if(org.length==0 && org==""){
27 27
		$(".basicmsg2").text("请输入您的姓名");
28 28
	}else{
@ -30,29 +30,29 @@ $("#org").blur(function(){
30 30
		orgPass=true;
31 31
	}
32 32
});
33

34
$("#saveProfessor").on("click",	function() {
35
				var $data = {};
36
				$data.name = $("#name").val();
37
				$data.orgId = $("#orgId").val();
38
				$data.orgName = $("#orgName").val();
39
				$data.title = $("#title").val();
40
				$data.department = $("#department").val();
41
				$data.id = id;
42
				if(orgPass&&namePass){
43
						$.ajax({"url" : "../ajax/professor",
44
							"type" :  "POST",
45
							"success" : function(rdata) {
46
								console.log(rdata);
47
								if (rdata.success) {									
48
										location.href="index.html";								
49
								} else {
50
									alert(rdata.msg);
51
								}
52
							},
53
							"data" : $data,
54
							"contentType" :"application/x-www-form-urlencoded",
55
							dataType : "json"
56
						});
57
				}
58
			});
33
	
34
	$("#saveProfessor").on("click",	function() {
35
		var $data = {};
36
		$data.name = $("#name").val();				
37
		$data.orgName = $("#orgName").val();
38
		$data.title = $("#title").val();
39
		$data.department = $("#department").val();
40
		$data.address = $("#address").val();
41
		$data.id = id;
42
		if(orgPass&&namePass){
43
				$.ajax({"url" : "../ajax/professor",
44
					"type" :  "POST",
45
					"success" : function(rdata) {
46
						console.log(rdata);
47
						if (rdata.success) {									
48
								location.href="index.html";								
49
						} else {
50
							alert(rdata.msg);
51
						}
52
					},
53
					"data" : $data,
54
					"contentType" :"application/x-www-form-urlencoded",
55
					dataType : "json"
56
				});
57
		}
58
	});