Copy link to clipboard
Copied
Hello, I have been struggling with this for a while and can't find my exact situation out there.
How can I hide 2 text fields and 2 checkbox fields based on a particular date range?
I have a form that includes a date field, after a certain date I don't want the fields to be available so I would like to hide those fields.
I tried the following, but I don't think I have the date syntax right. What am I doing wrong?
if(this.getField("Date").value >= "9/21/17"){
this.getField("Text3").display = display.hidden;
}
else{
this.getField("Text3").display = display.visible;
}
Thank you so much in advance!
Ok, so I replaced the field name with a number value in the script and it all works great. THANK YOU!!!
Now the last part needed for this form is to incorporate 2 late fees on the last section - if after 9/21/2017 the late fee is 25% and if after 10/21/2017 the late fee is 50%. I am not sure how to add the second late fee to the script you gave me.
This is my attempt, it's working but not calculating the 1.5 correctly, it's multiplying 1.5 by the result of the first late fee (125) resulting in a t
...Copy link to clipboard
Copied
It's an empty string. If the field is empty (that is, has not value) we should not try to convert it to a Date field, because doing that will result in the current date, which is incorrect.
Copy link to clipboard
Copied
Is valueAsString strictly Acrobat JavaScript?
Copy link to clipboard
Copied
It's a property of the Field object, which only exists in the Acrobat JS API, so yes.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more