[求助]两数相乘(懂了,可以看看吧,虽然很简单,但对我很重要,呵呵~~)
非常感谢
FormatNumber(csng(request("DANJIA"))*request("shuoliang"),1)
我试了不行,但是我知道怎么做了。红色部分是要加的就可以了。
<form name="frm" >
<tr class="tdbg" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F6FcF9'">
<td width="32%" align="right" >数量:</td>
<td width="66%" >
<input name=SHULIANG type=text id="SHULIANG" size=3 maxlength=3 onMouseOver="this.focus();" onChange="ZONGJIAHS(document.frm.DANJIA.value,this.value,document.frm.ZONGJIA)">个
</td>
</tr>
<tr class="tdbg" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F6FcF9'">
<td width="32%" align="right" >单价:</td>
<td width="66%" ><input name="DANJIA" type="hidden" id="DANJIA" value="5" onChange="ZONGJIAHS(this.value,document.frm.SHULIANG.value,document.frm.ZONGJIA)">
<%=request("DANJIA")%>
<span class="style3">5元</span>
</td>
</tr>
<tr class="tdbg" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F6FcF9'">
<td width="32%" align="right" >总价:</td>
<td width="66%" >
<input name=ZONGJIA type=text id="ZONGJIA" size=6 maxlength=6 >
<span class="style3">元</span>
</td>
</tr>
</form>
<script language="JavaScript" >
function ZONGJIAHS(SHULIANG,DANJIA,ZONGJIA)
{
ZONGJIA.value = DANJIA * SHULIANG;
}
</script>
<form name="frm" >
<tr class="tdbg" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F6FcF9'">
<td width="32%" align="right" >数量:</td>
<td width="66%" >
<input name=SHULIANG type=text id="SHULIANG" size=3 maxlength=3 onMouseOver="this.focus();" onChange="ZONGJIAHS(document.frm.DANJIA.value,this.value,document.frm.ZONGJIA)">个
</td>
</tr>
<tr class="tdbg" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F6FcF9'">
<td width="32%" align="right" >单价:</td>
<td width="66%" ><input name="DANJIA" type="hidden" id="DANJIA" value="5" onChange="ZONGJIAHS(this.value,document.frm.SHULIANG.value,document.frm.ZONGJIA)">
<%=request("DANJIA")%>
<span class="style3">5元</span>
</td>
</tr>
<tr class="tdbg" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F6FcF9'">
<td width="32%" align="right" >总价:</td>
<td width="66%" >
<input name=ZONGJIA type=text id="ZONGJIA" size=6 maxlength=6 >
<span class="style3">元</span>
</td>
</tr>
</form>
<script language="JavaScript" >
function ZONGJIAHS(SHULIANG,DANJIA,ZONGJIA)
{
ZONGJIA.value = DANJIA * SHULIANG;
}
</script>
[此贴子已经被作者于2006-12-8 17:18:39编辑过]