Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Select a field and copy to clipboard

New Here ,
Dec 26, 2020 Dec 26, 2020

In my PDF form I have combined a few text fields value and display in another text field (Fieldname-26). 

I need to select this field and copy to the clipbroad so that I can paste it to another application. 

Can I do it in JS ?   I am new to JS.  Thanks in advance

 

 

TOPICS
How to , JavaScript
1.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 26, 2020 Dec 26, 2020

No, Adobe removed this security vulnerability a long time ago, back in Acrobat 4 or 5.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 27, 2020 Dec 27, 2020

Thanks for the reply.  I have to highlight the content, copy and paste manually. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 28, 2020 Dec 28, 2020

function myFunction() {
  /* Get the text field */
  var copyText = document.getElementById("myInput");

  /* Select the text field */
  copyText.select();
  copyText.setSelectionRange(099999); /* For mobile devices */

  /* Copy the text inside the text field */
  document.execCommand("copy");

  /* Alert the copied text */
  alert("Copied the text: " + copyText.value);
}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 28, 2020 Dec 28, 2020

This function will not work in Adobe Acrobat or Acrobat Reader!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 28, 2020 Dec 28, 2020
LATEST

Corrrect. I have tried that. It does not work on PDF form.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines