• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to copy HTML page content to clipborad

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've seen how to copy stuff to the clipboard from a textarea using javascript, but what if I want to copy the whole page?

Please help me out inthis
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what's whole page' s meaning?

include 'html','head' and 'body' tags?
 
Anil Reddy V
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

example like HTML page is having a form with filled values init and form is having Text fileds now I want to copy the entair form content including labels and text field values into the clipboard.

Please help me out inthis regard.

Thanks,
 
H Light
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can use document.body.innerHTML copy you need

 
Anil Reddy V
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the Code

but my requirement is like as follows
Exzmple:
<html>
<body>
<form>
SOMETEXT: <input type="text" name="tx1" value="AAAA"/>
<table>
<tr>
<td>ONE</td><td>TWO</td><td>THREE</td>
</tr>
<tr>
<td>ONE</td><td>TWO</td><td>THREE</td>
</tr>
<tr>
<td>ONE</td><td>TWO</td><td>THREE</td>
</tr>
</table>
<input type="button" onClick="CopyToClipboard()" value="Copy to clipboard" />
<input type="button" onClick="RemoveClipboard()" value="Remove clipboard" />
<input type="button" onClick="Print()" value="Print" />
</form>
</body>
</html>

now when ever I click on the "Copy to clipboard" it has to copy toi clipboard in the following way

SOMETEXT: AAAA
ONE TWO THREE
ONE TWO THREE
ONE TWO THREE

Could you please help me inthis regard.
 
Anil Reddy V
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Finally I have solved the problem Thanks for all
 
Ranch Hand
Posts: 281
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Anil Reddy V wrote:
Finally I have solved the problem Thanks for all



Hi Anil Reddy V,

Please be a good rancher and tell us how you solved it, so that others having the same problem can benifit from this post.

Hope you do it for all your posts in future ;) Thanks.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic