Questions tagged [onpaste]

48 questions
16
votes
3 answers

How do you configure Firefox to allow Javascript to intercept a value pasted from the clipboard?

I need to filter out certain characters when a user pastes from the clipboard. (I don't actually want to modify what's in the clipboard.) I already have this working in IE. Sigh... tl;dr: capability.policy items in user.js make it into prefs.js but…
just mike
  • 1,164
  • 3
  • 12
  • 22
13
votes
4 answers

jQuery on("paste") for the first time doesn't grab or pass the value

Real deal problem for me, because I have no clue to resolve it. jQuery script I wrote should grab the input value on "paste" action and pass it by ajax to codeigniter controller. It actually works fine, but only if I paste the value for the second…
sznowicki
  • 1,351
  • 5
  • 16
  • 33
10
votes
2 answers

How to get the new value of a textarea input field on paste?

I see that when I try to read the value from a textarea field when its onpaste function is called, I get the old value of the field (the one before the paste operation), not the new value (the one after the paste operation). Here is a demonstration…
Susam Pal
  • 32,765
  • 12
  • 81
  • 103
6
votes
4 answers

How to determine if an onChange event was called by an onPaste

I have a Javascript function that is associated with an onChange event. I understand that some browsers support onPaste at either the document or an element level. Is there a way to determine if the onChange event was caused by a "paste" - I tried…
JJSO
  • 61
  • 1
  • 2
6
votes
4 answers

How to receive php image data over copy-n-paste javascript with XMLHttpRequest

I try to make an image-upload functionality similar to the one GMail uses. You copy (CTRL-C) an image from your desktop and paste (CTRL-V) it onto the website. The image is then uploaded via a XMLHttpRequest to a php-script that handles the…
poitroae
  • 21,129
  • 10
  • 63
  • 81
5
votes
1 answer

onpaste / paste event not firing for table on first few attempts

Google Chrome specific - this is an internal-use app that does not require cross-browser compatibility See http://jsfiddle.net/spetnik/vpcyt4yv/ I have a table into which I am attempting to allow pasting of data. I made the individual cells…
Aaron J Spetner
  • 2,117
  • 1
  • 18
  • 30
4
votes
2 answers

Ng-Paste - Accessing Pasted Data as an Array or List

The Idea We're building an app in Angular 1.5.x and we're trying to implement a feature that would allow the user to paste a single column of cells from an excel sheet or any other spreadsheet (single column, any number of rows deep) into an…
M. Irvin
  • 143
  • 1
  • 13
4
votes
0 answers

How can I get the modified value of an input field within the onPaste event?

I'm handling the onPaste event in a React application. The problem I'm having is that the value of the element isn't updated until after the paste event has finished and thus I'm unable to determine whether the pasted data overwrites the existing…
James Donnelly
  • 126,410
  • 34
  • 208
  • 218
4
votes
2 answers

Does ie10 support image pasting from clipboard?

Does ie10 support the ability to support copy and pasting an image. IE has the fileReader api which is nice, but it would be cool to have ability to paste a picture.
SamFisher83
  • 3,937
  • 9
  • 39
  • 52
4
votes
2 answers

HTML: onpaste="doSomething();" as invalid attribute

I am checking my HTML code with Amaya. I have an error on this line: And for the onpaste, I am getting…
Milos Cuculovic
  • 19,631
  • 51
  • 159
  • 265
3
votes
2 answers

How to filter insert html from some tags (contenteditable)

I have a tag div with an contenteditable = true attribute.When Paste events happen I want to filter pasted html from some tags.How can i do this ?
user12145474
3
votes
2 answers

Solution for onpaste in Opera <= 11.11

$('#sometextarea') .change(function(){console.log($(this).val());}) [0].onpaste=function(){ var self=$(this); var intr=setInterval(function(){ if(self.val().length) { clearInterval(intr); …
Somebody
  • 9,316
  • 26
  • 94
  • 142
3
votes
1 answer

how to disable pasting in one of the gwt textbox

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.
Pradip Borde
  • 2,516
  • 4
  • 18
  • 20
2
votes
0 answers

Vuetify v-textarea maxlength on devices

I have vuetify v-textarea in my page and problem with maxlength in it. In web all is good, but on devices when I paste text inside textarea and then typing I pass over maxlength.
Oleksii
  • 21
  • 2
2
votes
1 answer

React JS: onPaste not working as expected

I have a simple React component for a textarea that increases its size as the user types into it. The function looks like this: changeHeight(e) { const height = this.textarea.clientHeight; const scrollHeight = this.textarea.scrollHeight; …
a7dc
  • 3,323
  • 7
  • 32
  • 50
1
2 3 4