I have two textboxes and i want to just disable one of them from pasting anything. I have tried
sinkEvents( Event.ONPASTE );
but it disables both of the textboxes from pasting.
I have two textboxes and i want to just disable one of them from pasting anything. I have tried
sinkEvents( Event.ONPASTE );
but it disables both of the textboxes from pasting.
Try to create a custom TextBox
wherein you have to override onBrowserEvent
function.
public TextInput() {
super();
sinkEvents( Event.ONPASTE );
}
@Override
public void onBrowserEvent(Event event) {
super.onBrowserEvent( event );
switch (DOM.eventGetType(event)) {
case Event.ONPASTE:
event.preventDefault();
break;
}
}