asp.net 如何用js获取多个文本框内的值。我做的是个购物车,选中购物车里的商品。
我做的是个购物车,选中购物车里的商品。能获取商品的ID但是获取不到数量functiontemp(){varid=document.getElementsByName('c...
我做的是个购物车,选中购物车里的商品。能获取商品的ID但是获取不到数量
function temp() {
var id = document.getElementsByName('checkox');
var name = document.getElementById('user').value;
for (var i = 0; i < id.length; i++) {
if (id[i].checked == true) {
var shu = document.getElementById('shu').value;
alert(shu);
var a = id[i].value;
var b;
b = shopping.order_for(a, name, shu).value;
//window.location.href = 'dingdan.aspx';
}
}
}
<span class='reduce'></span> <input class='count-input' name='shu' id='shu' type='text' value='1' /><span class='add'>+</span> 展开
function temp() {
var id = document.getElementsByName('checkox');
var name = document.getElementById('user').value;
for (var i = 0; i < id.length; i++) {
if (id[i].checked == true) {
var shu = document.getElementById('shu').value;
alert(shu);
var a = id[i].value;
var b;
b = shopping.order_for(a, name, shu).value;
//window.location.href = 'dingdan.aspx';
}
}
}
<span class='reduce'></span> <input class='count-input' name='shu' id='shu' type='text' value='1' /><span class='add'>+</span> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询