Copy link to clipboard
Copied
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();
}
Copy link to clipboard
Copied
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;
Copy link to clipboard
Copied
A digital signature necessarily contains the date and time of signature.