asp html 提交表单前的判断、处理js
发布网友
发布时间:2022-04-24 09:00
我来回答
共1个回答
热心网友
时间:2023-10-19 00:58
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<script language="JavaScript" type="text/JavaScript">
JQ = $;
var userId=0;
var JP=$;
function minusNum(commodityId,count){
if(document.getElementById("num"+commodityId).value>1){
document.getElementById("num"+commodityId).value = document.getElementById("num"+commodityId).value-1;
}
SetSum(commodityId,count);
}
function plusNum(commodityId,num,count){
if(document.getElementById("num"+commodityId).value<num){
document.getElementById("num"+commodityId).value = document.getElementById("num"+commodityId).value-0+1;
}
SetSum(commodityId,count);
}
function SetSum(a,b)
{
document.getElementById("Sum"+a).value=document.getElementById("num"+a).value*document.getElementById("jishu"+a).value;
var ccc=0;
for(j=1;j<=b;j++)
{
ccc=ccc+parseInt(document.getElementById("Sum"+j).value);
}
document.getElementById("allSum").value=ccc;
}
</script>
<table width="980" border="0" cellspacing="0" cellpadding="0" class="zhangshu_1">
<tr>
<th>项目</th>
<th width="125">手机号码</th>
<th width="88">数量</th>
<th width="60"></th>
<th width="150">价格</th>
<th width="60">=</th>
<th width="150">总价</th>
</tr>
<form name="more" action="linepay.asp" method="post" >
<%
rRCount=2
for i=1 to rRCount%>
<tr>
<td style="line-height:22px"><a href="#">仅售26元!最高价值70元的仙踪林单人套餐,最高价值70元的仙踪林单人套餐,最高价值70元的仙踪林单人套餐,节假通用仅售26元!最高价值70元的仙踪林单人套餐,节假通用</a></td>
<td><input name="" class="shouji" onfocus="if(this.value=='用于接收短讯验证码'){this.value='';this.style.color='#000000'}" onblur="if(this.value==''){this.value='用于接收短讯验证码';this.style.color='#aba4a4'}" value="用于接收短讯验证码"/></td>
<td align="center"><span><input name="" onclick="javascript:minusNum(<%=i%>,<%=rRCount%>);" type="button" class="jian" /></span><input type="text" class="wen" name="commodityNumber" id="num<%=i%>" value="2"><span><input name="" onclick="javascript:plusNum(<%=i%>,30,<%=rRCount%>);" type="button" class="jia" /></span></td>
<td align="center">X</td>
<td align="center">¥26<input type="text" id="jishu<%=i%>" name="jishu<%=i%>" value="26" /></td>
<td align="center">=</td>
<td align="center" class="money"><font size="+2">¥52<input type="text" id="Sum<%=i%>" name"sum<%=i%>" value="<%=26*2%>" /></font></td>
</tr>
<%next%>
<tr>
<td colspan="5"><font size="+1" color="#FF0000">应付总额</font></td>
<td align="center">=</td>
<td align="center"><font size="+2">¥26<input type="text" id="allSum" name"allsum" /></font></td>
</tr>
</form>
</table>
</body>
</html>追问金额那里可以不可以不用 文本框呀
追答可以啊..换label呀...