Javascript Help: Saving user input in PDF file.
- February 10, 2025
- 2 replies
- 778 views
I am working on a user fillable form that would, when a Submit button is clicked, save the user filled input to a plain text PDF file. My input form looks like attachment.
I want the out to be saved like this:
Email: uniquelikeyou@example.com
Date Requested: 2/10/2025
Title:
First Name: Unique
MI:
Last Name: LikeYou
Suffix:
I was trying to use the following javascript to accomplish this. (Please note that my knowledge of javascript .01 on a scale off 0 to 10).
//Get Input
var sendTo = this.getField(“myEmail”).value;
var dateReq = this.getField(“DateRequested”).value;
var title1 = this.getField(“Title”).value;
var first = this.getField(“FirstName”).value;
var mInit = this.getField(“MI”).value;
var Last = this.getField(“LastName”).value;
var Suf = this.getField(“Suffix”).value;
//Output body
var body = “Email: “ + sendTo + ”\n” +
“Date Requested:” + dateReq + “\n” +
“Name: “ + title1 + “ “ + first + “ “ + mInit + “ “ + Last + “ “ + Suf + “\n” +
Save, body. [????]
[???? - This is where I need help, in case my above code is correct. When user presses Submit button, the system should save the body in a text format in a PDF file, say UserText.PDF]
