Questions tagged [onpaste]

48 questions
2
votes
1 answer

Paste Image using Javascript onpaste is not working for IE, working with chrome

I am trying to save a image/screenshot through paste Ctrl+V into a div #pasteImageDiv by user. Its working fine with Chrome but not working with IE. I am using IE10. Until now, what I have been able to find is that if I paste any text to div…
2
votes
1 answer

Get clipboard data in ng-paste directive?

I'm using angularjs 1.3.2. How to get clipboard data on paste event? This question is like: "Paste" event in Angular [ngPaste] But in this question, the angularjs version is 1.2. And this is not working in angularjs 1.3.2. Thanks.
Tavousi
  • 14,848
  • 18
  • 51
  • 70
2
votes
2 answers

Javascript Jquery on one of the multiple input fields changed

Lets say I have multiple input fields like distance, fuelConsumption, pricePerGallon and I need to calculate total price. But I want to calculate as the user types. So the total price need to be recalculated if any of those inputs changed. To get…
Einius
  • 1,352
  • 2
  • 20
  • 45
2
votes
3 answers

Jquery Mobile Paste event on input text

I'm using Jquery Mobile to develop an web app for Android and iPhone. I want to handle the event when the users change their value in the input text field. Initially, I use .on("keyup change") and everything seem to work ok. However, when the users…
VinhBS
  • 677
  • 8
  • 17
2
votes
1 answer

retrieving data after right-click paste

I am trying to evaluate some data entered into a textarea after a paste has occurred. When I use onkeyup it detects if fine and does the evaluation okay when the user uses Cntl-V to paste. It does nothing when they right-click and select paste. I…
1
vote
0 answers

onPaste converts the pasted file type to image

I am looking into solution when users can copy paste any file in order to upload it. I am using onPaste and when I console log on the event.clipboardData.files, I see that all the details within files is converted image even though I try to upload…
pnaika
  • 31
  • 4
1
vote
1 answer

how use onPaste in antD inputNumber Field to prevent input other than integers

I was using antD in my react project, I was using inputNumber Component of antD to get input, all I wanted is integer input and wanted to prevent all the other input from all source such as copy-pasting, keyboard. is there any way to do this?
1
vote
1 answer

How do I stop buttons from blocking an onPaste event

I have an image modal where the user can upload or paste an image. Both are working great, except currently I have the buttons on the modal capturing the focus, so pasting only works by manually clicking outside the buttons. I would like for any…
Frazer Kirkman
  • 1,003
  • 1
  • 14
  • 23
1
vote
1 answer

onKeypress in Vue 3 doesn't capture the last character of number

I tried to get the entered number in to a function in Vue with the following code.
1
vote
0 answers

console.dir(event.target.value) is empty string, but console.dir(event) shows a "full string" for the value property

I have an input element with an onPaste event handler. When I paste a string of text (eg "A string I pasted") into the input the event gives me an empty string "" value:
JimmyTheCode
  • 3,783
  • 7
  • 29
  • 71
1
vote
2 answers

How can I paste clipboard data after changing it in react?

I have defined the following event handler for the component handleChange(event) onPaste={(event) => handlePaste(event)} /> Within the event handler I'd like to stop the event from being dispatched and change…
1
vote
2 answers

How to prevent user from copy-pasting text with invalid characters into input text field immediately on copy-paste action?

I have read few answers online and here on stack overflow but I am not finding a solution. I am trying to prevent user from copy-pasting invalid characters (anything other than a-z A-Z characters) into my input field. I dont want to do this on…
pixel
  • 9,653
  • 16
  • 82
  • 149
1
vote
0 answers

Are PASTE events asynchronous? What is the best way to handle this?

Recently, I noticed a strange behaviour of paste events: the value of an input element is updated after the function is triggered! If you just pass to the function the value itself or event.target.value, the function gets an old input value; the…
Roman Karagodin
  • 740
  • 2
  • 11
  • 16
1
vote
2 answers

Javascript onpaste replaceAll

I want to paste in a textBox and after I paste it, it should replace all spaces with commas.