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

How do I auto fill a form field with the document name? Extra question ...

New Here ,
Jul 28, 2021 Jul 28, 2021

Copy link to clipboard

Copied

This was answered and works a treat. Thanks to Karl Heinz Kremer but I have one more question. How do I remove the file extension? (.pdf)

 

I'm using this code currently:

getField("Text1").value = documentFileName;

 

Please could someone give me the extra code to remove the file extension. 

 

Thanks in advance.

TOPICS
Create PDFs , How to , JavaScript , PDF forms

Views

301

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Expert , Jul 28, 2021 Jul 28, 2021

this.getField("Text1").value = this.documentFileName.replace(".pdf", "");

Votes

Translate

Translate
Community Expert ,
Jul 28, 2021 Jul 28, 2021

Copy link to clipboard

Copied

this.getField("Text1").value = this.documentFileName.replace(".pdf", "");

Votes

Translate

Translate

Report

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 ,
Jul 28, 2021 Jul 28, 2021

Copy link to clipboard

Copied

LATEST

You diamond! Works perfectly, thanks.

Votes

Translate

Translate

Report

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