Question
hide field according dates in Adobe JavaScript
Hello everyone,
I'm trying to create a PDF form where I'd like to hide 4 checkboxes if the date in the "Date From" field is
between 04/02/2023 and 05/03/2023.
If the "Date from" field is less than or greater than these 2 dates, then the checkboxes are visible.
Below what I started but it doesn't work at all..
Any ideas?
Thanks very much.
var date1 = "05/02/2023"
var date2 = "04/03/2023"
var date = this.getField("Date Du").valueAsString
if(date >= date1 && date >= date2) {
this.getField("LP 1h30 1").hidden = true;
this.getField("LP 1h30 2").hidden = true;
this.getField("LP 1h30 3").hidden = true;
this.getField("LP 1h30 4").hidden = true;
}
else {
this.getField("LP 1h30 1").hidden = false;
this.getField("LP 1h30 2").hidden = false;
this.getField("LP 1h30 3").hidden = false;
this.getField("LP 1h30 4").hidden = false;
}
