473,511 Members | 15,302 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Copy ASP variable to clipboard using Javascript

Hello,

I have a search function that is reading companies from a database via
ASP and spitting out the results. I have various fields of each company
in variables and I want to be able to create a link that uses
Javascript to copy the address to the clipboard.

I know there is the javascript:window.clipboardData.getData(), but I
can't get to parse the ASP variable through. Does anyone know how I can
do this.

Thanks in advance.

Dec 28 '06 #1
2 9942
<za*****@gmail.comwrote in message
news:11**********************@s34g2000cwa.googlegr oups.com...
Hello,

I have a search function that is reading companies from a database via
ASP and spitting out the results. I have various fields of each company
in variables and I want to be able to create a link that uses
Javascript to copy the address to the clipboard.

I know there is the javascript:window.clipboardData.getData(), but I
can't get to parse the ASP variable through. Does anyone know how I can
do this.
To copy "to the clipboard" use "setData()" not "getData()".

Will this help?
<html>
<head>
<title>Clipper.asp</title>
<script type="text/javascript">
function clipper() {
var data = document.getElementById("Data").value;
alert("Clipboard = \n\n" + data);
window.clipboardData.setData("Text", data);
}
</script>
</head>
<body>
<span id="Data" value="<%=Now%>"></span>
To place the current date and time in the clipboard
<a href="javascript:clipper()">click here</a>.
</body>
</html>
Dec 29 '06 #2
Thats perfect....thanks a lot!

Dec 29 '06 #3

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

Similar topics

7
7662
by: Wayne Wengert | last post by:
I have an ASP page in which I want to copy the contents of a variable (text) to the clipboard. Based on MSDN examples I tried window.clipboardData.setData(strTemp) and that generates an error...
5
4311
by: tabonni | last post by:
Hello All I am creating an ASP page. There are a list of filename and checkbox next to it. When user checked all the documents they want and click ADD TO CLIPBOARD button. All filepaths will be...
1
3103
by: dixie | last post by:
I am doing a job where I need to copy a letter header into each of about 100 letters which are mail merge template documents for about 20 different customers - all up about 2000 copy and pastes...
4
9179
by: Wayne Wengert | last post by:
I have an aspx page on which I am trying to copy the contents of a textbox to the client clipboard when the users clicks a button. The button code is as follows:...
7
11601
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard...
3
3709
by: SAL | last post by:
I have the following VB.net Class/Function that I call from an ASP.net page: Public Class MyTestClass Public Function embedHyperlink(ByVal fileID As Integer, ByVal fileName As String) As String...
3
1575
by: zakhirn | last post by:
Hello, I have a search function that is reading companies from a database via ASP and spitting out the results. I have various fields of each company in variables and I want to be able to create...
3
2630
by: Bruce A. Julseth | last post by:
I want to copy to a clipboard from my webpage using data that is available from an hidden variable on <inputstatement. Using window.clipboardData.setData("Text", "This text value"); in a...
0
7153
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
7371
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,...
0
7432
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
7517
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...
1
5077
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
452
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...

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.