asp html 提交表单前的判断、处理js
要做原有的网站上放一张提交订单的页面,<htmlxmlns="http://www.w3.org/1999/xhtml"><head><metahttp-equiv="C...
要做原有的网站上放一张提交订单的页面,
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>提交订单</title>
<style type="text/css">
.order{ margin:20px 200px 0 0;border:#F00 solid 1px;
}
.morebuy,.morebuy td{ border:1px solid #999; font-size:14px;
border-collapse:collapse;
}
</style>
</head>
<body>
<table width="579" height="372" class="morebuy">
<tr>
<td width="254">产品名称</td>
<td width="102">舒适版</td>
<td width="81">豪华版(提供发票)</td>
<td width="60">数量</td>
<td width="48">价格</td>
</tr>
<form name="more" action="linepay.asp" method="post" >
<tr>
<td>卧式沙发</td>
<td> <label>
<input type="radio" name="RadioGroup1" value="单选" id="RadioGroup1_0" />
1000元</label>
</td>
<td>
<label>
<input type="radio" name="RadioGroup1" value="单选" id="RadioGroup1_1" />
1500元</label> </td>
<td><input name="" type="text" size=5/></td>
<td> </td>
</tr>
<tr>
<td>电视柜</td>
<td>
<label>
<input type="radio" name="RadioGroup2" value="单选" id="RadioGroup2_0" />
800元</label>
</td>
<td><label>
<input type="radio" name="RadioGroup2" value="单选" id="RadioGroup2_1" />
1600元</label>
</td>
<td><input name="" type="text" size=5/></td>
<td> </td>
</tr>
<tr>
<td>低背沙发</td>
<td><label>
<input type="radio" name="RadioGroup4" value="单选" id="RadioGroup4_0" />
800元</label></td>
<td><label>
<input type="radio" name="RadioGroup4" value="单选" id="RadioGroup4_1" />
1200元</label></td>
<td><input name="" type="text" size=5/></td>
<td> </td>
</tr>
<tr>
<td>餐厅沙发</td>
<td> <label>
<input type="radio" name="RadioGroup5" value="单选" id="RadioGroup5_0" />
8000元</label></td>
<td></td>
<td><input name="" type="text" size=5/></td>
<td> </td>
</tr>
<tr>
<td>办公沙发</td>
<td><label>
<input type="radio" name="RadioGroup2" value="单选" id="RadioGroup2_0" />
6000元</label></td>
<td> </td>
<td><input name="" type="text" size=5/></td>
<td> </td>
</tr>
</table><input name="submit" type="submit" value="提交订单" />
<input name="reset" type="reset" value="重写"> <font color="#FF0000">共计<% %> 元</font>
</form>
</body>
</html> 展开
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>提交订单</title>
<style type="text/css">
.order{ margin:20px 200px 0 0;border:#F00 solid 1px;
}
.morebuy,.morebuy td{ border:1px solid #999; font-size:14px;
border-collapse:collapse;
}
</style>
</head>
<body>
<table width="579" height="372" class="morebuy">
<tr>
<td width="254">产品名称</td>
<td width="102">舒适版</td>
<td width="81">豪华版(提供发票)</td>
<td width="60">数量</td>
<td width="48">价格</td>
</tr>
<form name="more" action="linepay.asp" method="post" >
<tr>
<td>卧式沙发</td>
<td> <label>
<input type="radio" name="RadioGroup1" value="单选" id="RadioGroup1_0" />
1000元</label>
</td>
<td>
<label>
<input type="radio" name="RadioGroup1" value="单选" id="RadioGroup1_1" />
1500元</label> </td>
<td><input name="" type="text" size=5/></td>
<td> </td>
</tr>
<tr>
<td>电视柜</td>
<td>
<label>
<input type="radio" name="RadioGroup2" value="单选" id="RadioGroup2_0" />
800元</label>
</td>
<td><label>
<input type="radio" name="RadioGroup2" value="单选" id="RadioGroup2_1" />
1600元</label>
</td>
<td><input name="" type="text" size=5/></td>
<td> </td>
</tr>
<tr>
<td>低背沙发</td>
<td><label>
<input type="radio" name="RadioGroup4" value="单选" id="RadioGroup4_0" />
800元</label></td>
<td><label>
<input type="radio" name="RadioGroup4" value="单选" id="RadioGroup4_1" />
1200元</label></td>
<td><input name="" type="text" size=5/></td>
<td> </td>
</tr>
<tr>
<td>餐厅沙发</td>
<td> <label>
<input type="radio" name="RadioGroup5" value="单选" id="RadioGroup5_0" />
8000元</label></td>
<td></td>
<td><input name="" type="text" size=5/></td>
<td> </td>
</tr>
<tr>
<td>办公沙发</td>
<td><label>
<input type="radio" name="RadioGroup2" value="单选" id="RadioGroup2_0" />
6000元</label></td>
<td> </td>
<td><input name="" type="text" size=5/></td>
<td> </td>
</tr>
</table><input name="submit" type="submit" value="提交订单" />
<input name="reset" type="reset" value="重写"> <font color="#FF0000">共计<% %> 元</font>
</form>
</body>
</html> 展开
1个回答
展开全部
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>提交订单</title>
<style type="text/css">
.order{ margin:20px 200px 0 0;border:#F00 solid 1px;
}
.morebuy,.morebuy td{ border:1px solid #999; font-size:14px;
border-collapse:collapse;
}
</style>
<script>
function aa (val,value){
document.getElementById("show"+val).innerHTML=value * document.getElementById('count'+val).value ;
sum();
}
function sum (){
var count=5;
var sum=0
for(var i=0;i<count;i++){
sum +=+document.getElementById('show'+i).innerHTML;
}
document.getElementById('sum').innerHTML=sum;
}
</script>
</head>
<body>
<table width="579" height="372" class="morebuy">
<tr>
<td width="254">产品名称</td>
<td width="102">舒适版</td>
<td width="81">豪华版(提供发票)</td>
<td width="60">数量</td>
<td width="48">价格</td>
</tr>
<form name="more" action="linepay.asp" method="post" >
<tr>
<td>卧式沙发</td>
<td>
<input type="radio" name="RadioGroup1" value="单选" id="RadioGroup1_0" onclick="aa('0','1000')"/>
<label>1000元</label>
</td>
<td>
<input type="radio" name="RadioGroup1" value="单选" id="RadioGroup1_1" onclick="aa('0','1500')"/>
<label>1500元</label> </td>
<td><input id="count0" type="text" size=5/ value="1"></td>
<td><span id="show0"></span></td>
</tr>
<tr>
<td>电视柜</td>
<td>
<label>
<input type="radio" name="RadioGroup2" value="单选" id="RadioGroup2_0" onclick="aa('1','800')" />
800元</label>
</td>
<td><label>
<input type="radio" name="RadioGroup2" value="单选" id="RadioGroup2_1" onclick="aa('1','1600')"/>
1600元</label>
</td>
<td><input id="count1" type="text" size=5 value="1"/></td>
<td><span id="show1"></span></td>
</tr>
<tr>
<td>低背沙发</td>
<td><label>
<input type="radio" name="RadioGroup4" value="单选" id="RadioGroup4_0" onclick="aa('2','800')"/>
800元</label></td>
<td><label>
<input type="radio" name="RadioGroup4" value="单选" id="RadioGroup4_1" onclick="aa('2','1200')"/>
1200元</label></td>
<td><input id="count2" type="text" size=5 value="1"/></td>
<td><span id="show2"></span></td>
</tr>
<tr>
<td>餐厅沙发</td>
<td>
<input type="radio" name="RadioGroup5" value="单选" id="RadioGroup5_0" onclick="aa('3','8000')"/>
<label>8000元</label></td>
<td></td>
<td><input id="count3" type="text" size=5 value="1"/></td>
<td><span id="show3"></span></td>
</tr>
<tr>
<td>办公沙发</td>
<td>
<input type="radio" name="RadioGroup2" value="单选" id="RadioGroup2_0" onclick="aa('4','6000')" />
<label>6000元</label></td>
<td> </td>
<td><input id="count4" type="text" size=5 value="1"/></td>
<td><span id="show4"></span></td>
</tr>
</table><input name="submit" type="submit" value="提交订单" />
<input name="reset" type="reset" value="重写"> <font color="#FF0000">共计<span id=sum></span> 元</font>
</form>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>提交订单</title>
<style type="text/css">
.order{ margin:20px 200px 0 0;border:#F00 solid 1px;
}
.morebuy,.morebuy td{ border:1px solid #999; font-size:14px;
border-collapse:collapse;
}
</style>
<script>
function aa (val,value){
document.getElementById("show"+val).innerHTML=value * document.getElementById('count'+val).value ;
sum();
}
function sum (){
var count=5;
var sum=0
for(var i=0;i<count;i++){
sum +=+document.getElementById('show'+i).innerHTML;
}
document.getElementById('sum').innerHTML=sum;
}
</script>
</head>
<body>
<table width="579" height="372" class="morebuy">
<tr>
<td width="254">产品名称</td>
<td width="102">舒适版</td>
<td width="81">豪华版(提供发票)</td>
<td width="60">数量</td>
<td width="48">价格</td>
</tr>
<form name="more" action="linepay.asp" method="post" >
<tr>
<td>卧式沙发</td>
<td>
<input type="radio" name="RadioGroup1" value="单选" id="RadioGroup1_0" onclick="aa('0','1000')"/>
<label>1000元</label>
</td>
<td>
<input type="radio" name="RadioGroup1" value="单选" id="RadioGroup1_1" onclick="aa('0','1500')"/>
<label>1500元</label> </td>
<td><input id="count0" type="text" size=5/ value="1"></td>
<td><span id="show0"></span></td>
</tr>
<tr>
<td>电视柜</td>
<td>
<label>
<input type="radio" name="RadioGroup2" value="单选" id="RadioGroup2_0" onclick="aa('1','800')" />
800元</label>
</td>
<td><label>
<input type="radio" name="RadioGroup2" value="单选" id="RadioGroup2_1" onclick="aa('1','1600')"/>
1600元</label>
</td>
<td><input id="count1" type="text" size=5 value="1"/></td>
<td><span id="show1"></span></td>
</tr>
<tr>
<td>低背沙发</td>
<td><label>
<input type="radio" name="RadioGroup4" value="单选" id="RadioGroup4_0" onclick="aa('2','800')"/>
800元</label></td>
<td><label>
<input type="radio" name="RadioGroup4" value="单选" id="RadioGroup4_1" onclick="aa('2','1200')"/>
1200元</label></td>
<td><input id="count2" type="text" size=5 value="1"/></td>
<td><span id="show2"></span></td>
</tr>
<tr>
<td>餐厅沙发</td>
<td>
<input type="radio" name="RadioGroup5" value="单选" id="RadioGroup5_0" onclick="aa('3','8000')"/>
<label>8000元</label></td>
<td></td>
<td><input id="count3" type="text" size=5 value="1"/></td>
<td><span id="show3"></span></td>
</tr>
<tr>
<td>办公沙发</td>
<td>
<input type="radio" name="RadioGroup2" value="单选" id="RadioGroup2_0" onclick="aa('4','6000')" />
<label>6000元</label></td>
<td> </td>
<td><input id="count4" type="text" size=5 value="1"/></td>
<td><span id="show4"></span></td>
</tr>
</table><input name="submit" type="submit" value="提交订单" />
<input name="reset" type="reset" value="重写"> <font color="#FF0000">共计<span id=sum></span> 元</font>
</form>
</body>
</html>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询