I have a GridView
where I have several TextBox
that are generated according to their total rows.
I would like to block Control+V
in all TextBox
.
I use Jquery 1.4
, and so I read the on
method currently used for the new
Jquerys is the live
in Jquery 1.4
.
I tried the following code but I did not succeed and not the error in the log.
I know that every TextBox
generated is also generated ID
different.
Can anyone help me?
My Jquery
$("#<%=tbNaoAtende.ClientID%>").live('paste',function (e) {
e.preventDefault();
});
$("#<%=tbNaoAtendeInic.ClientID%>").live('paste', function (e) {
e.preventDefault();
});
$("#<%=tbAtendeRess.ClientID%>").live('paste', function (e) {
e.preventDefault();
});
$("#<%=tbAtende.ClientID%>").live('paste', function (e) {
e.preventDefault();
});
My aspx
<asp:GridView ID="rptListaVerificacao" runat="server" PageSize="50" AutoGenerateColumns="false" SkinID="gridLV" AllowPaging="True" Width="100%">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Table ID="tbAtendimentos" runat="server" Style="font-weight: bold; border: solid 1px #c0c0c0;"
CellPadding="5">
<asp:TableRow>
<asp:TableCell>
<asp:Literal ID="Literal3" runat="server" Text="<%$Resources:Resource, nao_atende%>"></asp:Literal>:</asp:TableCell>
<asp:TableCell Style="padding-right: 20px;">
<asp:TextBox ID="tbNaoAtende" runat="server" Width="40px" CssClass="numero"></asp:TextBox></asp:TableCell>
<asp:TableCell>
<asp:Literal ID="Literal4" runat="server" Text="<%$Resources:Resource, nao_atende_iniciativa%>"></asp:Literal>:</asp:TableCell>
<asp:TableCell Style="padding-right: 20px;">
<asp:TextBox ID="tbNaoAtendeInic" runat="server" Width="40px" CssClass="numero"></asp:TextBox></asp:TableCell>
<asp:TableCell>
<asp:Literal ID="Literal9" runat="server" Text="<%$Resources:Resource, atende_ressalva%>"></asp:Literal>:</asp:TableCell>
<asp:TableCell Style="padding-right: 20px;">
<asp:TextBox ID="tbAtendeRess" runat="server" Width="40px" CssClass="numero"></asp:TextBox></asp:TableCell>
<asp:TableCell>
<asp:Literal ID="Literal10" runat="server" Text="<%$Resources:Resource, atende%>"></asp:Literal>:</asp:TableCell>
<asp:TableCell Style="padding-right: 20px;">
<asp:TextBox ID="tbAtende" runat="server" Width="40px" CssClass="numero"></asp:TextBox></asp:TableCell>
<asp:TableCell>
<asp:LinkButton ID="lbtAtualizaAtendimento" runat="server" Text="<%$Resources:Resource, atualiza_atendimento%>"
OnClick="lbtAtualizaAtendimento_Click"></asp:LinkButton></asp:TableCell>
</asp:TableRow>
</asp:Table>
</asp:TemplateField>
</Columns>
</asp:GridView>