程序怎么写要?要和他这个一样!
这个要怎么实现?
http://www.cinatrade.com/shippingcost.jsp?ctlWeight=1717.0&ctlDiscount=1
看看我给你写的,比你那个先进多了
<script type="text/javascript">
function ChangeSubmit() {
var Q = document.form1.Q.value;
var E = document.form1.E.options[document.form1.E.selectedIndex].value;
if (E == "0") {alert("没有选择币种 !"); return false;} else {document.getElementById("A").innerHTML = Round(Q*E/0.5,2);}
}
function Quantity() {
var Q = document.form1.Q.value;
var E = document.form1.E.options[document.form1.E.selectedIndex].value;
if (Q == "") {alert("数量不能为空或为0 !"); return false;} else {
if (E == "0") {alert("没有选择币种 !"); return false;} else {document.getElementById("A").innerHTML = Round(Q*E/0.5,2);}
}
}
function Round(Num,Bit) {return(Math.round(Num*Math.pow(10,Bit))/Math.pow(10,Bit));}
</script>
<table width="80%" border="1" cellpadding="5" style="border-collapse:collapse;" bordercolor="#C0C0C0">
<form name="form1" action="shippingcost.jsp" method="post">
<tr>
<td width="25%"><strong>Quantity :</strong> <input type="text" name="Q" size="5" value="1" onkeyup="Quantity();" /></td>
<td width="40%"><strong>Country :</strong>
<select name="E" onchange="ChangeSubmit();">
<option value="0" selected>Please Select Countries</option>
<option value="1.56">United States</option>
<option value="2.48">United Kingdom</option>
<option value="3.62">Switzerland</option>
<option value="4.53">Sweden</option>
</select>
</td>
<td width="35%">Shipping cost : $ <span id="A" style="color:red;"></span></td>
</tr>
</form>
</table>
Quantity *** | Country1 *** | |
Quantity *** | Country2 ***** | |
Quantity *** | Country3 ******* |
[此贴子已经被作者于2007-9-7 1:51:17编辑过]