You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gdms/web/jsFile/search.js

67 lines
1.8 KiB

6 years ago
$(document).ready(function () {
$(document).off('click',searchStuMsg).on('click','.search-button.teacher',searchStuMsg);
$(document).off('click',searchTeaMsg).on('click','.search-button.student',searchTeaMsg);
$(document).off('keydown',KDsearchSmsg).on('keydown','.search-button.teacher',KDsearchSmsg);
$(document).off('keydown',KDsearchTmsg).on('keydown','.search-button.student',KDsearchTmsg);
$(document).off('click',teacherSelect).on('click','.select-it.teacher',teacherSelect);
6 years ago
$(document).off('click',studentSelect).on('click','.select-it.student',studentSelect);
6 years ago
})
function searchStuMsg(e) {
6 years ago
if($('.search-input').val()=='')
{
e.preventDefault();
alert('请输入学号');
}
else {
var id=$('.search-input').val();
var searchType='teacher';
var rqDate={"id":id,"searchType":searchType};
6 years ago
var Url1='result_list.jsp';
$('.list-frame').load(Url1,rqDate);
}
}
function searchTeaMsg(e) {
if($('.search-input').val()=='')
{
e.preventDefault();
alert('请输入学号');
}
else {
var id=$('.search-input').val();
var searchType='student';
var rqDate={"id":id,"searchType":searchType};
var Url1='result_list.jsp';
$('.list-frame').load(Url1,rqDate);
}
}
function KDsearchSmsg(e) {
if(e.keyCode==13)
{
searchStuMsg(e);
}
}
function KDsearchTmsg(e) {
6 years ago
if(e.keyCode==13)
{
searchTeaMsg(e);
6 years ago
}
}
function select_one(Url2,button) {
var id=button.val();
6 years ago
var selectDate={"id":id};
if(button.html()!="已选")
{$.post(Url2,selectDate,function (data,status) {
if(status=='success')
6 years ago
{
button.addClass('on').html("已选");
6 years ago
}
})}
}
function studentSelect() {
var button=$(this);
select_one("testfrom.jsp",button);
}
function teacherSelect() {
var button=$(this);
select_one("testfrom.jsp",button);
6 years ago
}