Skip to main content
VickiBros
Participant
February 12, 2023
Question

Save fillable form using the "project title" form field data as the file name

  • February 12, 2023
  • 1 reply
  • 1068 views

I do not know javascript, but need to create a button action in a pdf form that will save the document using the "project title" form field data as the file name. Below is what I have pulled together and have no luck. When I hit save, nothing happens. I've read through the posts and see similar questions, but can't figure anything out. 

 

// Get the value of the form field
var fieldValue = this.getField("projecttitle").value;

// Create a file name using the form field value
var fileName = fieldValue + ".pdf";

// Save the PDF with the specified file name
this.saveAs(fileName);

This topic has been closed for replies.

1 reply

VickiBros
VickiBrosAuthor
Participant
February 12, 2023

Thank you; from what I've read, this needs to be a trusted function so I will review these tutorials. 

Thom Parker
Community Expert
Community Expert
February 13, 2023