Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


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

26

Likes

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

Adobe Community Professional , Jul 28, 2021 Jul 28, 2021
this.getField("Text1").value = this.documentFileName.replace(".pdf", "");

Likes

Translate

Translate
Adobe Community Professional ,
Jul 28, 2021 Jul 28, 2021

Copy link to clipboard

Copied

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

Likes

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.

Likes

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