Copy link to clipboard
Copied
I want to make it so that it will auto populate the times like below. So if i put 2:00 pm on the first one it will show 2:15 pm on the next one. So far i got this working on foxit editor with the code below. Any idea on how I can get it working on adobe acrobat too?
if(this.getField("Time CheckedRow10").value!="")
{
var minutesadd= 15
var btest= this.getField("Time CheckedRow10")
var time= new Date("01-01-1970 "+ btest.value);
time.setTime(time.getTime()+minutesadd*60000)
event.value=util.printd("hh:MM tt",time);
}
Copy link to clipboard
Copied
Change this line:
var time= new Date("01-01-1970 "+ btest.value);
To:
var time= util.scand("hh:MM tt","01-01-1970 "+ btest.value);
Copy link to clipboard
Copied
I see no reason it shouldn't work in Acrobat. What happens when you use it?
Copy link to clipboard
Copied
shows as 12:00 am. Is there another way to do this that i can try?
Copy link to clipboard
Copied
Change this line:
var time= new Date("01-01-1970 "+ btest.value);
To:
var time= util.scand("hh:MM tt","01-01-1970 "+ btest.value);
Copy link to clipboard
Copied
OMG TYTYTY!!! hahaha i should have asked earlier stuck on this for 2 days already
Copy link to clipboard
Copied
Is there a way to copy this script into the form field properties without having to change the field name to add the 15 minutes to each time? I have increments of 15 minutes and there are 96 entries for a day's time (24 hours in 15 minute increments).
Copy link to clipboard
Copied
When I change the first box which should autopopulate the entire row, only the first 3 boxes populate correctly and the rest remain as they previously were. They work if I go into the javascript individually, but that defeats the purpose. HELP!!
Copy link to clipboard
Copied
- If the fields are named consistently then you can do it using a script under the first field. You don't need to duplicate the code to the other fields.
- Did you check the JS Console for errors?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now