473,796 Members | 2,654 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1280
Ivo
"Mark Thomas" <mr*@thomaszone .com> wrote in message
news:a0******** *************** ***@posting.goo gle.com...
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="fnPast e(this)">
<script etc.>
function fnPaste(el){
event.returnVal ue=false;
// stops default action
a=window.clipbo ardData.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
1778
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? TIA TY
2
5872
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 results of the query into a table? Also, if you're in a table and you run a filter and have the rows you like - is there a way to copy those results into a new table? I know in excel, after you've done a filter and have the rows you're looking...
12
1745
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'. If you are curious, run the code yourself. if(args.Length != 1)
0
1906
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 solution, I would be interested. Thank you. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim cmd As System.Data.SqlClient.SqlCommand cmd = New System.Data.SqlClient.SqlCommand
2
1421
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. When a textbox is populated, the validator should write out the index of the row that triggered it. And it does--twice. e.g. If you type something into the first row, you see "0 0." If you type something into the first and third rows, you...
0
1043
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 contains a standard set of information, where one of the fields of information is an image, can I paste that entire set of results into a DB table including images? I've been able to paste from such results pages into tables with all the data...
0
1238
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 that on the results page the order of the questions (sorted by specified question numbers) are slightly jumbled, while on the user form they work fine. I've looked at these mysql queries for a while but can't seem to pinpoint the problem. I'll paste...
9
3064
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. Below you will find the code I've written and the error that results. I'm hoping that someone can give me some direction as to what syntax or parameter is missing from the code that is expected by VBA. Overview: I'm trying to copy calculated...
1
1211
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 mouseover the column, the tooltip shows but only for 5 seconds, not long enough and you can't copy and paste whats in the tooltip. Is there a extension in ajax that i can use to mouseover or hoverover that will let me copy the results and paste it? If...
16
2727
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
9527
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10453
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10223
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9050
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5441
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.