If you have a repeating field of the names form, the values ββare combined with commas.
So, for example, if you have the following.
<input type="text" name="name" value=""> <input type="text" name="name" value="">
.. Your resulting value in the Request.Form feedback is as follows:
name=,,
What's happening.
Here are some possible solutions to your problem, although I have not tested them :)
1) UpdatePanel
From reading, it seems that if you create an UpdatePanel for the network control (< asp:TextBox ID="txtQty" runat="server"></asp:TextBox> ), it fixes this problem. Again, I have not tested this
2) Changing the behavior of DataBind () during Page_Load()
So...
page_load() { if(!isPostBack()) { // DataBind normally myGridview.DataBind(); } else { //Some intelligent way to remove commas before binding } }
... But this does not change the fact that ,,,values are published in the first place. So, if you are primarily concerned about aesthetics rather than behavior, you can simply use JS to highlight commas (as previously assumed).
3) JS - Get rid of the comma:
(as suggested here )
<script type="text/javascript"> $("[src*=plus]").live("click", function () { $(this).closest("tr").after("<tr><td></td><td colspan = '999'>" + $(this).next().html() + "</td></tr>") $(this).attr("src", "images/minus.png"); $("input", $(this).closest("tr").next()).each(function () { this.value = this.value.substring(',', ''); }); }); $("[src*=minus]").live("click", function () { $(this).attr("src", "images/plus.png"); $(this).closest("tr").next().remove(); }); </script>
Hope this helps :)
[Change] - Verification
I would disable validation using the .keydown () event. In your case, it might look something like this:
// Bind to each input with id='txtQty', in each row, in the "gridview" with id='gvWarehouseDetails' $("#gvWarehouseDetails tr input[id*='txtQty']").each(function () { $(this).keydown(function (event) { // <