PDF Editing Issues

How to Auto-Populate Name and Date After Digitally Signing a PDF

Huma Ashraf ChHuma Ashraf Ch Nov 2, 2026 869 views

Question details

The user wants to automatically fill in a client's name and approval date in a PDF form immediately after a certificate-based digital signature is applied.

How to Automatically Populate a Name Field After Digitally Signing a PDF
Product
PDF Editor
Device & OS
not provided
Scenario
Creating an interactive PDF form that requires digital signatures and needs to automatically extract and display the signer's certificate details in separate text fields.
Observed behavior
The form author needs a method to retrieve the certificate information upon signature application and map it to specific text fields (like name and date).
Before you start

Ensure your PDF editing software supports form field JavaScript and that you have already created the target text fields (e.g., 'SigName' and 'SigDate') in your document.

Solution 1Recommended

Use JavaScript on the Signature Field's Signed Tab

Use the signatureInfo() method in a custom JavaScript to extract the certificate name and date, then populate read-only text fields automatically upon signing.

By attaching a script directly to the digital signature field, the PDF can automatically pull data from the user's digital certificate the moment it is applied. It is also good practice to make these destination text fields read-only so users cannot manually alter the generated values.

1
Open form editing mode

Open your PDF document and enter Form Editing mode. Ensure you have your Digital Signature field and the blank text fields (e.g., SigName, SigDate) placed on the page.

2
Access signature properties

Double-click the Digital Signature field to open its Properties dialog box.

3
Navigate to the Signed tab

Go to the 'Signed' tab in the Properties window and select the option 'This script executes when field is signed'.

4
Enter the custom JavaScript

Click 'Edit' or 'Add' to input your script. You will use event.target.signatureInfo() to pull the certificate details and map them to your fields using this.getField('FieldName').value.

5
Set destination fields to read-only

Double-click your target text fields (SigName and SigDate), go to the General tab, and check the 'Read-Only' box to prevent manual editing.

Use JavaScript on the Signature Field's Signed Tab
Recommended JavaScript Code: Use this script to handle both signing and clearing the signature: var f = event.target; if (f.signatureValidate() == 4) { var info = f.signatureInfo(); this.getField('SigName').value = 'Signed by: ' + info.name; this.getField('SigDate').value = 'Signed on: ' + info.date; } else { this.getField('SigName').value = ''; this.getField('SigDate').value = ''; }
Powerful PDF Editor

Edit and Manage PDF Forms with WPS Office

WPS PDF provides comprehensive form editing features, allowing you to easily add digital signatures, interactive text fields, and customize field properties to create professional documents.

  1. 1. Open your PDF: Launch WPS Office and open your PDF document.
  2. 2. Access the Form tab: Navigate to the 'Form' tab on the top ribbon to view all interactive field tools.
  3. 3. Add fields: Select the 'Digital Signature' tool or 'Text Field' tool and click on the document to place them.
  4. 4. Customize properties: Double-click the fields to rename them, set them to read-only, and configure their appearance before saving the document.
Easily insert and manage digital signature fieldsCreate interactive PDF forms with customizable text boxesHigh compatibility with Adobe Acrobat PDF formatsLightweight and user-friendly interface for seamless workflow
microsoft office alternative - wps office

Frequently Asked Questions

Can I auto-populate the date without using a digital signature?

Yes, you can use a custom JavaScript on a standard text field or a document-level script to populate the current date when the PDF is opened or printed, bypassing the need for a certificate.

Why aren't my text fields updating after I sign the document?

Ensure that the field names in your JavaScript exactly match the actual names of the text fields in the PDF form. JavaScript is case-sensitive, so 'SigName' is different from 'signame'.

What happens to the populated names if the digital signature is removed?

If you use a validation check in your script (like checking if signatureValidate() == 4), you can program the else condition to automatically clear the populated name and date fields when the signature is cleared.