<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>添加数据</title>
<script type="text/jscript" src="http://cdn.17zuoye.com/public/framework/scripts/jquery-1.7.1.min.js?v=1.0.1"></script>
<link rel="stylesheet" type="text/css" href="http://cdn.17zuoye.com/public/app/blue/css/widget.css">
</head>
<body>
<div class="cross_form_wrap">
老师姓名及一起作业学号:
<select id="clazzs">
<option value="0">请选择</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
班级名称:
<select id="clazz_box">
<option value="0">请选择</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
</select>
<a class="public_x_b green_x_b" href="javascript:void(0);"><i><span><input id="inputask_but" type="submit" value="申请" /></span></i></a>
</div>
<div class="table_list_warp">
<table class="tab_all">
<thead>
<tr>
<th colspan="3" style="text-align:left;">我的申请列表</th>
</tr>
</thead>
<tbody id="asktable_box">
</tbody>
</table>
</div>
<script>
$(function(){
$("#inputask_but").on("click", function(){
var _teacherId = $("#clazzs").val();
var _clazzId = $("#clazz_box").val();
if ( $("#asktable_box tr[v="+_clazzId+"]").length > 0 ) {
return;
}
var _teaherName = $("#clazzs").find('option:selected').text();
var _clazzIdName = $("#clazz_box").find('option:selected').text();
$("#asktable_box").append('<tr vt="'+_teacherId+'" v="'+_clazzId+'"><td>'+ _teaherName +'-'+ _teacherId + '</td><td>'+ _clazzIdName +'-'+ _clazzId +'</td><td> <a class="delete_row_but" href="javascript:void(0);">删除</a></td></tr>');
});
$(".delete_row_but").live("click", function(){
var _this = $(this);
_this.parent().parent().remove();
});
});
</script>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>添加数据</title>
<script type="text/jscript" src="http://cdn.17zuoye.com/public/framework/scripts/jquery-1.7.1.min.js?v=1.0.1"></script>
<link rel="stylesheet" type="text/css" href="http://cdn.17zuoye.com/public/app/blue/css/widget.css">
</head>
<body>
<div class="cross_form_wrap">
老师姓名及一起作业学号:
<select id="clazzs">
<option value="0">请选择</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
班级名称:
<select id="clazz_box">
<option value="0">请选择</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
</select>
<a class="public_x_b green_x_b" href="javascript:void(0);"><i><span><input id="inputask_but" type="submit" value="申请" /></span></i></a>
</div>
<div class="table_list_warp">
<table class="tab_all">
<thead>
<tr>
<th colspan="3" style="text-align:left;">我的申请列表</th>
</tr>
</thead>
<tbody id="asktable_box">
</tbody>
</table>
</div>
<script>
$(function(){
$("#inputask_but").on("click", function(){
var _teacherId = $("#clazzs").val();
var _clazzId = $("#clazz_box").val();
if ( $("#asktable_box tr[v="+_clazzId+"]").length > 0 ) {
return;
}
var _teaherName = $("#clazzs").find('option:selected').text();
var _clazzIdName = $("#clazz_box").find('option:selected').text();
$("#asktable_box").append('<tr vt="'+_teacherId+'" v="'+_clazzId+'"><td>'+ _teaherName +'-'+ _teacherId + '</td><td>'+ _clazzIdName +'-'+ _clazzId +'</td><td> <a class="delete_row_but" href="javascript:void(0);">删除</a></td></tr>');
});
$(".delete_row_but").live("click", function(){
var _this = $(this);
_this.parent().parent().remove();
});
});
</script>
</body>
</html>