1

i'm using a simple code to select all text inside textarea but i want the button to copy the text into the clipboard instead of using right click or Ctrl+c. here's the select code:

<form>
<textarea name='text_area' rows=1 cols=20 >large/<?php echo $row['Img_Name']; ?> 
</textarea> 
<input type='button' value='select path' onClick='javascript:this.form.text_area.focus(); this.form.text_area.select();'>
</form></div>

many websites add buttons to copy code or text just open this page and click share on the video and choose embed you'll get a copy button without the need to select the text or add the website to the white list http://techcrunch.com/2014/03/13/zuckerberg-called-obama-to-express-frustration-over-new-nsa-revelations/?source=gravity

1

1 Answer 1

1

mozilla, like most other browsers doesn't let js manipulate the clipboard, unless the user set your website on a whitelist.

http://kb.mozillazine.org/Granting_JavaScript_access_to_the_clipboard

in response to your edited question: the video uses flash to copy to clipboard. There are several librarys that do so using hidden Flash content, for example ZeroClipboard

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.