After previous post which is copying data to clipboard, now it’s time to paste the clipboard data to textarea. I give an example when the page load, the data are paste to textarea.
<script type=”text/javascript”>
function pasteClipboard() {
txt = document.form1.textareaName.createTextRange();
txt.execCommand(‘Paste’);
}
</script>
<BODY onload=”pasteClipboard()”>
<form action=”” name=”form1″ method=”post”>
<TEXTAREA NAME=”textareaName”></TEXTAREA>
</form>
</body>
Remember this code only works in IE.
Archive for July, 2009
Javascript – Paste Clipboard Data To Textarea
Javascript – Copy Data To Clipboard
When you add a button to your form which will perform the action of copying data to the clipboard, you will need this following function, but unfortunately it works only in IE.
<script type=”text/javascript”>
function CopyToClipBoard(txt) {
if (window.clipboardData) {
window.clipboardData.setData(“Text”,txt);
}
}
</script>
<form name=”form1″>
<textarea name=”txtarea” >The data to be copied</textarea>
<input type=”button” value=”Copy To Clipboard” onclick=”CopyToClipBoard(document.form1.txtarea.value);”>
</form>
Before copying data to clipboard it’s good [...]
Javascript Highlight Text Area
You may have noticed that whenever you want you to copy code from a text area when it got focus it will highlight all of the code for you to copy and paste onto your website. Well I thought I will share that code snippet with you as it can be very handy.
<form name=”form1″>
<textarea name=”textarea” [...]
- How to implement jQuery facebox plugin
- PEAR Install Spreadsheet_Excel_Writer
- PHP code to display Alexa rank
- PHP Configurations for Uploading File
- wp_insert_post could not insert post into the database
- PHP in_array() and array_search() functions
- Storing array data to MySQL using PHP
- How To Write print_r Output To File
- PHP Redirect Page
- Remove Non ASCII Characters From A String
- Avinash in PEAR Install Spreadsheet_Excel_Writ…
- paratenilesh in Extjs PHP MySQL Simple Tutorial
- yoube.info in Remove Mybrowserbar From My Browser…
- Alzuun in Remove Mybrowserbar From My Browser…
- RMK in Remove Mybrowserbar From My Browser…
- Laura in Remove Mybrowserbar From My Browser…
- Mitani in Remove Mybrowserbar From My Browser…
- Manila Director… in Remove Mybrowserbar From My Browser…
- Arak in Remove Mybrowserbar From My Browser…
- Angel in Remove Mybrowserbar From My Browser…
Joana's Starcraft 2 Strategy Guide
New Starcraft 2 Guide by Joana. This is a full strategy guide for Blizzard Entertainment's new game Starcraft 2.
Full Automated Ebook Download Store
Get your own profitable automated digital download store! Preinstalled with more than 100 ebooks to get you started! Totally automated checkout system!
Arcade Income
Start Your Own Arcade in 4 minutes and make money too!
- Remove Mybrowserbar From My Browser
- Javascript - Get URL Parameters
- Fireworks: Make Rounded Corner Edges Image
- Get Domain Name From URL Using Javascript
- Hp Proliant ml350 g6 Win2003 Server Setup Bluescreen
- Merge Table Cells Using Javascript
- Extjs PHP MySQL Simple Tutorial
- Wp-O-Matic Plugin Cannot Add Campaign
- Javascript: Open new window containing php page
- Mozilla Firefox Add-ons for Downloading YouTube Video
- check string convert ip to number convert ip to numeric value copy table to a new table copy table using mysql dll file domain name domain name from url Export Data fireworks horizontal line effect get domain from url get url parameters golfer social network import data javascript alert javascript alert method javascript dialogue box javascript get url parameter javascript load php page javascript open new window javascript open php page javascript pops up javascript prompt javascript tabbed page JQuery Example location href merge table cells Motion Trail Text mysql copy table mysql ip to number PC Router php compress file php create zip file php error PHP fatal error php how to upload file php ip to number php session how to php uploaded file rounded corner edges image url domain url domain name WinXP auto logon WinXP File Sharing zip using php