$(document).ready(function () { $('.scenario-input').keypress(function (e) { alert('aa'); var a = []; var k = e.which; for (i = 48; i < 58; i++) a.push(i); // allow a max of 1 decimal point to be entered if (this.value.indexOf(".") === -1) { a.push(46); } if (!(a.indexOf(k) >= 0)) e.preventDefault(); alert('KeyCode: ' + k); }); });
<asp:UpdatePanel ID="uy1" runat="server"> <ContentTemplate> <asp:Button ID="b" runat="server" OnClick="b_Click" /> <asp:GridView ID="GridView1" runat="server" Visible="false"> <Columns> <asp:TemplateField> <ItemTemplate> <asp:TextBox ID="id1" runat="server" class="scenario-input"></asp:TextBox> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> </ContentTemplate> </asp:UpdatePanel>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)