add days to date

fj.jansen 16 Jun, 2011
Hello, i have to add 20 days to a date which is filled in a field. I start with adding a script in the form.
d = new Date(); (or a field, but date() is just for the example)
alert(d); (it will be a field but just as an example)
This is working but i get the very long dateformat including timezone. and i just want short.

i tried after that e.g:
myDate = new Date(day, month,year);
or
var myDate=new Date();
myDate.setDate(myDate.getDate()+5);
but this is not working.
before i can count 20 days at a date, the basic must be working. I tried several java format functions, but not working. Can you help me?
regards,
GreyHead 21 Jun, 2011
Hi fj.jansen ,

Which version of ChronoForms are you using?

And where are you adding the 20 days? It is probably easiest to do it after the form is submitted unless you need to show the result to the user?

Bob
This topic is locked and no more replies can be posted.