PDF script to clear fields
Hello, I'm having trouble with a PDF document script to reset fields when the document is opened on a different date than the date of the last edit. I've tried the code below, but it didn't work for me. Can someone here assist me with this? Thanks
function clearFormOnNewDate() {
var today = new Date();
var lastFilledDate = this.getField("date").value; // Replace "date" with the actual field name in your PDF
if (lastFilledDate != today.toLocaleDateString()) {
this.getField("date").value = "";
this.getField("off").value = "Select Off";
this.getField("untitled9").value = "";
// Clears fields
}
}