3
I have a GridView
where I have some TextBox
that are generated according to the total lines of the same.
I’d like to block the Control+V
in all the TextBox
.
Use the Jquery 1.4
, and from what I read the method on
currently used for the new
Jquerys corresponds to live
in the Jquery 1.4
.
I tried the following code but did not succeed and not log error.
I know that each TextBox
generated is also generated a ID
different.
Can someone 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>
How to call this function in an element dynamically created Raí? Could explain better?
– Renan Gomes
Raí you are pasting the same code I put above.
– Marconi
I didn’t realize, I made a mention of your code.
– Raí