473,396 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How do you get the results of a paste?

I need to get text pasted into a form field at the time it was pasted.
The value of the field is still blank in the onpaste handler. The
onchange event is not triggered until the input loses focus, and I
want to execute a function before that happens. How can I do that?

Thanks.
Jul 20 '05 #1
1 1252
Ivo
"Mark Thomas" <mr*@thomaszone.com> wrote in message
news:a0**************************@posting.google.c om...
I need to get text pasted into a form field at the time it was pasted.
The value of the field is still blank in the onpaste handler. The
onchange event is not triggered until the input loses focus, and I
want to execute a function before that happens. How can I do that?


Use onpaste (IE only as far as I am aware):
<input type="text" onpaste="fnPaste(this)">
<script etc.>
function fnPaste(el){
event.returnValue=false;
// stops default action
a=window.clipboardData.getData('Text');
// what they think they were about to paste
el.value = a.replace(/ /g,'_');
// or whatever you would like to do
}
</script>


Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Tyler Smith Watu | last post by:
I will like to seperate the contents of sp_dbfixedrolepermission into groups by the fixedrole (With the LUXURY of a heading).Is there a any short way or straight forward command to do that? ...
2
by: Matthew Kramer | last post by:
Once you have created a table through a query, is there a way to make that dataset into an Access "table" rather than a table/dataset generated by a query? Maybe someway to cut and paste the...
12
by: Jack | last post by:
Imagine if someone asked which of the follwing two methods of encoding an integer into a byte array was quicker. The purpose is in preparation for sending across a socket as part of a 'header'....
0
by: Rob | last post by:
I doubt this is the best way to do it, but what I came up with was to hide the XML in an HTML Comment then edit the file deleting the HTML stuff and keep the XML results. If anyone has a better...
2
by: 2obvious | last post by:
Below is a cut-and-paste code example that runs. It demonstrates some results which confuse me. It uses a DataGrid to make a table with 12 rows, each containing a TextBox and a CustomValidator....
0
by: Caleb.Howe | last post by:
I have to perform a function that seems both simple and complex at the same time. My question is whether or not Access will do it for me. If I have a page of search results, each entry of which...
0
by: Luongo | last post by:
Hi, I'm working on a mysql-based survey program. On the user page I display the survey form, and on the admin page I display the results for each question. The problem, which I find puzzling, is...
9
by: Kelii | last post by:
I've been trying to get this piece to work for a few hours, but have given up. I hope someone out there can help, I think the issue is relatively straightforward, but being a novice, I'm stumped....
1
by: Herman Walker | last post by:
I am creating single line table columns dynamacially in and ajax UpdatePanel with text results. The results really contains a bulk of data which i put in a tooltip. The problem is that when i...
16
by: Jorge | last post by:
Webkit r34469 vs. Opera 9.50 : 3.00x as fast 6339.6ms(Opera) 2109.8ms (Webkit) ----- FF3.0 (final) vs. Opera 9.50 : 1.94x as fast 6339.6ms (Opera) 3269.6ms (FF3)
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.