62,254
社区成员
发帖
与我相关
我的任务
分享<input type="text" name="texRelationsPosition1" class="input1_net" /><input type="text" name="txtRelationsContact1" class="input1_net" />,我想请问下,如何判断是否为空呢?
function checkNull(tablename,names)
{
var table = document.getElementById(tablename);
for(var i=0; i<table.rows.length; i++)
{
var temp = table.rows[i].cells[i].getElementsByTagName("input");
for(var i=0; i<temp.length;i++)
{
if(temp[i].value == "" || temp[i].value == null)
{
alert(names+"不能为空!");
return false;
}
}
}
}
//根据输入的数量获得小计
function GetSubprice(rowNew)
{
var select = rowNew.getElementsByTagName('select');
var price = rowNew.getElementsByTagName('input');
var subtotal = rowNew.getElementsByTagName('input');
var count = rowNew.getElementsByTagName('input');
var Total = document.getElementById("txtTotalPrice");
for(var i=0;i<types.length - 1;i += 3)
{
if(select[0].options[select[0].selectedIndex].value == types[i])
{
price[1].value = types[i+2];
var a = parseFloat(count[0].value);
var b = parseFloat(price[1].value);
subtotal[2].value =parseFloat( a*b);
GetTotalPrice();
break;
}
}
}