select onchange事件

qilinlin830 2009-04-12 01:00:39
各位:
有问题请教,关于select的onchange事件,在选择select的选项时能触发,现在我要实现的功能是在匹配了options值的时候就触发onchange事件
我的代码如下,在正在价格审核中的时候出现一个select框。请赐教
<script language="JavaScript">


function addseq(){
with(document.all("statusT")){
var myrow=insertRow();
myrow.id = "seqRow";
var mycell=myrow.insertCell();
mycell.innerHTML = "等待 "+ "<select name=auditseq><option value='02'>1</option><option value='03'>2</option><option value='04'>3</option><option value='05'>4</option></select>"+" 审批";
}
}

function changstatus(statusval){
if(statusval=='IP'||statusval=='03'||statusval=='04'||statusval=='05'){
addseq();
}
else{
with(document.all("statusT")){
try{
for(var i = 0; i <= rows.length; i++){
if(rows[i].id == "seqRow"){
deleteRow(i);
break;
}
}
}catch(e){
}
}
}
}
</script>
<html>
<table id="statusT" cellspacing="1" name="statusT">
<tbody>
<tr height="50">
<input type="hidden" name="customerOrderCode" value="${orderHead.customerOrderCode}">
<input type="hidden" name="change" value="Y">
<td>将该订单转为:
<select onchange='changstatus(this.value)' name="status">
<option value="NT" <c:if test="${orderHead.status == 'NT'}">selected</c:if>>未技术评审</option>
<option value="TA" <c:if test="${orderHead.status == 'TA'}">selected</c:if>>技术评审未通过</option>
<option value="NR" <c:if test="${orderHead.status == 'NR'}">selected</c:if>>未技术复审</option>
<option value="02" <c:if test="${orderHead.status == '02'}">selected</c:if>>未价格审批</option>
<option value="IP" <c:if test="${orderHead.status =='03'||orderHead.status =='04'||orderHead.status =='05'}">selected</c:if>>正在进行价格审批</option>
</script>
<option value="PN" <c:if test="${orderHead.status == 'PN'}">selected</c:if>>价格审批未通过</option>
</select></td>
</tr>
</tbody>
</table>
</html>
...全文
395 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧