日期:2014-05-16 浏览次数:20343 次
<tr id="tr_1">
<td width="13%" align="center" valign="middle"><input name="txt_course[1]" type="text" id="txt_course" size="22" /></td>
<td width="25%" align="center" valign="middle"><input name="txt_date1" type="text" id="txt_date1" size="14" />
至
<input name="txt_date2" type="text" id="txt_date2" size="14" /></td>
<td width="16%" align="center" valign="middle"><input name="txt_institution[1]" type="text" id="txt_institution" size="24" /></td>
<td align="center" valign="middle"><select name="sele_assistant" id="sele_assistant">
<?php
$sql ="SELECT `id` , `name` , `contact`
FROM `home_assistant`
ORDER BY `home_assistant`.`updatetime` DESC";
$sql =mysql_query($sql,$conn);
$arr = array();
while($home_assistant = mysql_fetch_array($sql)){
echo<<<EOD
<option value="$home_assistant[id]">$home_assistant[name]【$home_assistant[contact]】</option>
EOD;
};
?>
</select></td>
<td width="15%" align="center" valign="middle"><textarea name="tar_explain[1]" id="tar_explain" cols="22" rows="1"></textarea></td>
<td width="8%" align="center" valign="middle"><a href="right_add_student.php?id=1">增加</a> <a href="#" >删除</a></td>
</tr>
<html class="">
<head>
<meta charset="UTF-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js" type="text/javascript"></script>
<script>
$(function(){
$("table input[type='button'][target='add']").click(function(){//绑定新增按钮事件
var currentTable=$(this).closest("table");//获取当前table
var newTr=$("tr:eq(1)",currentTable).clone().show();
$("input[type='button'][target='remove']",newTr).one("click",function(){
$(this).closest("tr").remove();
});
currentTable.append(newTr);
});
});
</script>
</head>
<body>
<table width="842" border="1" cellpadding="0" cellspacing="0">
<tr>
<td width="363">&