日期:2014-05-16 浏览次数:20516 次
<script type="text/javascript"> function makePlus(t1,t2,t3){ var n1=Math.abs(document.getElementById(t1).value); var n2=Math.abs(document.getElementById(t2).value)+Math.abs(document.getElementById(t3).value); if(n1>n2){ alert('数量输入有误'); } } </script> <input id="t1" name="tt1" value="12"> <input id="t2" name="tt2" value="122"> <input id="t3" name="tt3" onChange="makePlus('t1','t2','t3')">
<input id="t3[]" name="tt3[]" onChange="makePlus('t1','t2','t3')">