当没有标签时,我的 ajax 代码运行良好.. 但我需要表单标签我该怎么办?.. 这是我的代码..
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script>
function injury_nature(){
$.ajax({
type:"POST",
url:"ajax_details.php",
data:{
allvals:$("#nature_id").val(),
},
success:function(msg){
$("#div").html(msg);
}});
}
</script>
<form method="post" action="process.php">
<table border="2">
<tr><th colspan="2">Injury Details</th></tr>
<tr><td>
<select id="nature_id" name="injury_nature" onChange="injury_nature()">
<option><--select--></option>
<option value="1">Musculoskeletal Injuries</option>
<option value="2">Soft Tissue Injuries</option>
<option value="3">Illnesses</option>
<option value="4">Other Injuries</option>
</select>
</td>
<td><div id="div"></div></td></tr>
</table>
当有表单标签时,我收到此错误:
TypeError: injury_nature is not a function
injury_nature()
请帮帮我,非常感谢。