I am trying to get an If/Else statement to return a calculated date. Since I don't know how to JavaScript, I have been looking in the adobe forums and other googled sources. I can't seem to get anything to work. Here's what the issue is.
The form I am working in imports data from another form using a saved FDF file. Among the fields that it imports are ones called AGE, DateStart (which is the person's birthdate), and DateEnd (which is the current date).
In this form, I have created fields called ExpDate and ExpDatePed. ExpDate calculates a date 10 years out from the DateEnd field (10 years from the current date). ExpDatePed calculates a date 18 years out from the DateStart field (the person's 18th birthday). All of these fields are working properly.
I have another text field called Text1. This is the one I am having trouble with. What I need this field to do is use an if/else statement to determine whether to return the value in the ExpDate field or the value in the ExpDatePed field by determining if the number in the AGE field is less than 18 or not.
Here's the script I was trying to use, but it says that there are illegal characters.
Any help would be greatly appreciated.
var strStart=this.getField(“ExpDate”).value;
var strEnd=this.getField(“ExpDatePed”).value;
var strYears=this.getField(“AGE”).value;
if(strYears<18)
{
event.value=strEnd;
}
else
{
event.value=strStart;
}
Hope this helps.