asp多选框选择自动提交数据到提交到当前页
网页上有很多商品,是多选的,我想当选正商品时能在下面显示去商品的价格,垒加
------解决方案-------------------- <div align= "center "> 请选择你要购买的商品: <br />
<input type= "checkbox " value= "1000 " id= "i1 " onclick= "$(this) " /> <label for= "i1 "> 太阳 </label> <br />
价格:1000 <br />
<input type= "checkbox " value= "2000 " id= "i1 " onclick= "$(this) " /> <label for= "i1 "> 月亮 </label> <br />
价格:2000 <br />
<input type= "checkbox " value= "3000 " id= "i1 " onclick= "$(this) " /> <label for= "i1 "> 星星 </label> <br />
价格:3000 <br />
合计金额: <span id= "sp_money " style= "color:#FF0000; font-weight:bolder; "> 0 </span>
</div>
<script language= "javascript " type= "text/javascript ">
function $(obj)
{
var money=getId( "sp_money ");
if(obj.checked)
{
money.innerHTML=parseInt(money.innerHTML)+parseInt(obj.value);
}
else
{
money.innerHTML=parseInt(money.innerHTML)-parseInt(obj.value);
}
}
function getId(id)
{return document.getElementById(id);}
</script>