gridview 中textbox 的判断
前台源码为:<asp:GridView id="gvNeedDrugs" runat="server" Width="100%" AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="jzd_id" ></asp:BoundField>
<asp:BoundField HeaderText="名称" DataField="jzd_name" ></asp:BoundField>
<asp:BoundField HeaderText="规格" DataField="jzd_guige" ></asp:BoundField>
<asp:BoundField HeaderText="厂家" DataField="jzd_factory" ></asp:BoundField>
<asp:BoundField HeaderText="所需数量" DataField="jzd_needno" ></asp:BoundField>
<asp:BoundField HeaderText="单价" DataField="Jzd_onemoney" />
<asp:TemplateField>
<HeaderTemplate>
捐助数量
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Width="90px" Text="0" onclick="this.value=''" onBlur=""
onKeyUp="this.value=this.value.replace(/\D/g,'');" onafterpaste="this.value=this.value.replace(/\D/g,'');"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="已捐数量" DataField="jzd_nowno" ></asp:BoundField>
</Columns>
<HeaderStyle CssClass="tb_sxyp" />
</asp:GridView>
实现的功能是:
在textbox 输入捐助数量后,判断此值是否大于所需数量-已捐数量,否则提示错误。重新输入。在触发onBlur事件时怎么编写js ?