不知道到底发生了什么,但这绝对是在浪费我的时间。这是我的javascript函数:
<script type="text/javascript" >
function loadSponsorName() {
var sp_id = document.getElementById('sponsor_id').value;
var murl = 'load_sponsor.php?sp_id='+sp_id+'';
var a=new Ajax(murl,{
method:"post",
onComplete: function(response){
$('sponsorName').setHTML(response);
}
}).request();
}
</script>
在表格内这是我的输入
<tr>
<td width="33%" height="20">
<label id="namemsg" for="name">Sponsor ID:</label>
</td>
<td width="67%">
<input type="text" name="sponsor_id" id="sponsor_id" size="40" value="" class="inputbox required" maxlength="50" onkeyup="loadSponsorName();" /> *
</td>
</tr>
<tr>
<td height="20">
<label id="namemsg" for="name">Sponsor Name:</label>
</td>
<td><div id="sponsorName">
<input type="text" name="sponsor_name" id="sponsor_name" size="40" value="" class="inputbox required" maxlength="50" /> *
</div></td>
</tr>
似乎 onkeyup 事件甚至没有调用该函数。
有人可以帮助我吗?