Copy link to clipboard
Copied
Hello
Appreciate help to create java script
When I put issue date of passport it will appear automatically date of Expiry for passport
For example
If insert Date of issue: 29/5/2024
Feild of Date of Expiry shown automatically: 28/5/2031
Regards,
It looks like the expiry date is 7 years from the issue date, but you don't say that. Is it? Enter the following custom calculation script in the Date of Expiry Field:
var issue=this.getField("Date of issue").value;
if(!issue)
{event.value=""}
else
{
var date=issue;
var d = util.scand("dd/mm/yyyy", date);
d.setFullYear(d.getFullYear() +7);
d.setDate(d.getDate()-1)
event.value = util.printd("dd/mm/yyyy",d);
}
Copy link to clipboard
Copied
It looks like the expiry date is 7 years from the issue date, but you don't say that. Is it? Enter the following custom calculation script in the Date of Expiry Field:
var issue=this.getField("Date of issue").value;
if(!issue)
{event.value=""}
else
{
var date=issue;
var d = util.scand("dd/mm/yyyy", date);
d.setFullYear(d.getFullYear() +7);
d.setDate(d.getDate()-1)
event.value = util.printd("dd/mm/yyyy",d);
}
Copy link to clipboard
Copied
Hi @ali_3480
Are you able to make toe correct JS now?
Copy link to clipboard
Copied
Yes dear
It is working