Personal greetings,
I have a generic javascript util.js file with a function to not allow copy and paste.
$('input').bind('copy paste', function (e) {
e.preventDefault();
});
On a specific page, I need a given field to copy and paste, and I did not want to get rid of util.js that it does not allow on other pages of the application. Is there any way to allow paste? Or turn off this validation for the specific page?
Thank you
Edit1: I called the unbind () method; right on the page that way and it worked
$(document).ready(function() {
$("input").unbind();
However, it works for all inputs on the screen. I tried to pass the id / field name as a parameter but it did not work. Ideally, only one field would allow copying and pasting.
Thank you in advance
Edit2:
The field that needs to allow copy and paste is this:
<td width="306" align="center">
<s:textfield id="idDesc%{#rowStatus.index}" cssClass="bg_input txtTable" cssStyle="%{listDespRec[#rowStatus.index].listError[2].aplicarCss}" name="listDespRec[%{#rowStatus.index}].observacaoLancamento" value="%{listDespRec[#rowStatus.index].observacaoLancamento}" size="35" maxlength="30"/>
</td>
Any suggestions on how to pass this field on unbind?
This way it is not working here
$(document).ready(function() {
$('#listDespRec[%{#rowStatus.index}].observacaoLancamento').unbind('copy paste');