哪位大师给帮忙!??我想实现两个价格2选1为标准然后再求和!!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<script type="text/javascript">
function abc(){
var abc=document.getElementsByName("cards");
document.getElementsByName("cardzhi")[0].value="";
for(var i=0; i<abc.length; i++){
if(abc[i].checked){
document.getElementsByName("cardzhi")[0].value+=abc[i].value;}}}
function startCalc(){
interval = setInterval("calc()",1);}
function calc(){
//alert("yy");
fi= document.getElementsByName("firstBox");
//alert(fi[0].value)
se = document.getElementsByName("secondBox");
thi = document.getElementsByName("thirdBox");
for (i=0;i<fi.length;i++){
thi[i].value=((fi[i].value)*1)*((se[i].value)*1);
}
//two = document.autoSumForm.secondBox.value;
//document.autoSumForm.thirdBox.value = (one * 1) + (two * 1);
}
function stopCalc(){
clearInterval(interval);}
function app(){
o=document.getElementById("aa");
str=o.innerHTML;
//alert(str);
o1=document.getElementById("bb");
//alert(o1.html);
o1.innerHTML= o1.innerHTML+"</br>"+str;}
function sum(){//加总
thi = document.getElementsByName("thirdBox");
tot = document.getElementsByName('totalBox');
tot[0].value="0";
for(i=0;i<thi.length;i++){
if(thi[i].value!=''){
tot[0].value=tot[0].value*1+thi[i].value*1;}}}
</script>
<body>
<form name="autoSumForm" id="form1">
<table width="825" border="1">
<div id="aa">
<tr>
<td>贴现价</td>
<td>现金价</td>
<td>数量</td>
<td>小计</td>
<td> </td>
</tr>
<tr>
<td width="234"><input name="cards" type="checkbox" value="2.00" onclick="abc()"/>2.00 <input type="text" name="cardzhi" value="" size="6"></td>
<td width="168"><input type="checkbox" name="firstBox" value="2.30" onFocus="startCalc();" onBlur="stopCalc();sum();">
2.30 <input type="text" name="cardzhi" value="" size="6"></td>
<td width="168"><input type=text name="secondBox" value="" onFocus="startCalc();" onBlur="stopCalc();sum();" size="6"></td>
<td width="168"><input type=text name="thirdBox" size="6"></td>
<td width="53"> </td>
</tr>
<br></div>
<tr>
<td> </td>
<td><input type=text name="firstBox" value="1.60" onFocus="startCalc();" onBlur="stopCalc();sum();" size="6"></td>
<td><input type=text name="secondBox" value="" onFocus="startCalc();" onBlur="stopCalc();sum();" size="6"></td>
<td><input type=text name="thirdBox" size="6"></td>
<td> </td>
</tr>
<br>
<div id="bb"><tr>
<td> </td>
<td><input type=text name="firstBox" value="5.20" onFocus="startCalc();" onBlur="stopCalc();sum();" size="6"> </td>
<td><input type=text name="secondBox" value="" onFocus="startCalc();" onBlur="stopCalc();sum();" size="6"> </td>
<td><input type=text name="thirdBox" size="6"></td>
<td> </td>
</tr>
</div>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td>合计:
<input type="text" name="totalBox" value="0" / size="8"></td>
<td> </td>
</tr>
</table>
</form>
</body>
</html>