100分!gridview编辑状态下有4个文本框··要自动计算前3个文本框中float数据类型的值的积··求实现JS代码··
gridview编辑状态下有4个文本框··要自动计算前3个文本框中float数据类型的值的积··求实现JS代码··
我自己写的JS但不行
function jsh(obj1,obj2,obj3,obj4)
{
var value1=obj1.value;
var value2=obj2.value;
var value3=obj3.value;
var value4=obj4.value;
if(document.all.TextBox5.value!=0)
{
value1=(document.all.TextBox5.value);
} else
{
value1=0;
}
if(document.all.TextBox8.value!=0)
{
value2=(document.all.TextBox8.value);
} else
{
value2=0;
}
if(document.all.TextBox11.value!=0)
{
value3=(document.all.TextBox11.value);
} else
{
value3=0;
}
if(document.all.TextBox14.value!=0)
{
value4=(document.all.TextBox14.value);
} else
{
value4=0;
}
document.all.TextBox33.value=parseFloat(value1)+parseFloat(value2)+parseFloat(value3)+parseFloat(value4)
}
gridview代码··
<asp:TemplateField HeaderText="用量(Yid)" SortExpression="yid">
<EditItemTemplate>
<asp:TextBox ID="TextBox4" runat="server" Height="22px"
Text='<%# Bind("yid") %>' Width="50px" onkeyup="buliao(this,this,this,TextBox6)"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%# Bind("yid") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="单价(price)" SortExpression="price">
<EditItemTemplate>
<asp:TextBox ID="TextBox5" runat="server" Height="22px"
Text='<%# Bind("price") %>' Width="50px" onkeyup="buliao(this,this,this,TextBox6)"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label5" runat="server" Text='<%# Bind("price") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="价格(Total)" SortExpression="total">
<EditItemTemplate>