Skip to main content
Participant
October 16, 2023
Question

I want to create a rule that signature field is not active until the date is filled in

  • October 16, 2023
  • 2 replies
  • 393 views

I have 2 text fields. One where you should fill in the current date, and one signature field. 

 

I want it to be impossible to sign the form without filling in the date. Below is the code i have tried, that does not work. This code is applied to "Date field - Actions - Run a JavaScript" 

 

var dateField = this.getField("Signature Completion Date"); // Replace with the actual name of your date field
var signatureField = this.getField("DMY"); // Replace with the actual name of your signature field

if (dateField.value === "") {
app.alert("Please fill in the date field before signing.", 3);
} else {
// Allow the signature field to be signed
signatureField.signatureSign();
}

This topic has been closed for replies.

2 replies

JR Boulay
Community Expert
Community Expert
October 16, 2023

A digital signature necessarily contains the date and time of signature.

Acrobate du PDF, InDesigner et Photoshopographe
Nesa Nurani
Community Expert
Community Expert
October 16, 2023

You can use this as validation script of date field, it will set signature field to read only until date field is filled:

this.getField("DMY").readonly = event.value == "" ? true : false;