1个回答
展开全部
<form name="tfrm">
<select name="s1" onchange="javascript:doit(this.form);"><option value="1">1<option value="2">2<option value="3">3</select>
<select name="s2" onchange="javascript:doit(this.form);"><option value="1">1<option value="2">2<option value="3">3</select>
<select name="s3" onchange="javascript:doit(this.form);"><option value="1">1<option value="2">2<option value="3">3</select>
<select name="s4" onchange="javascript:doit(this.form);"><option value="1">1<option value="2">2<option value="3">3</select>
<input type="text" name="t1" value="">
</form>
<script language="javascript">
function doit(ofrm){
ofrm.t1.value=parseInt(ofrm.s1.value)+parseInt(ofrm.s2.value)+parseInt(ofrm.s3.value)+parseInt(ofrm.s4.value);
}
</script>
<select name="s1" onchange="javascript:doit(this.form);"><option value="1">1<option value="2">2<option value="3">3</select>
<select name="s2" onchange="javascript:doit(this.form);"><option value="1">1<option value="2">2<option value="3">3</select>
<select name="s3" onchange="javascript:doit(this.form);"><option value="1">1<option value="2">2<option value="3">3</select>
<select name="s4" onchange="javascript:doit(this.form);"><option value="1">1<option value="2">2<option value="3">3</select>
<input type="text" name="t1" value="">
</form>
<script language="javascript">
function doit(ofrm){
ofrm.t1.value=parseInt(ofrm.s1.value)+parseInt(ofrm.s2.value)+parseInt(ofrm.s3.value)+parseInt(ofrm.s4.value);
}
</script>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询