Hello,
I wanted to ask if there is possibility to have a time field that has two options:
1. The time we enter manually
2. Current time
It would be similar to the Date field where we can choose any date or today's date.
Thanks for your help!
Magda
Solved! Go to Solution.
Views
Replies
Total Likes
try this on initialize
var event = new Date();
field.rawValue=event.toLocaleTimeString('en-US');
I am not sure if you can do it as you suggest but you van have a button next to your time field that set the value of the TimeField to the current time. Like this
If the TimeField format as HH:MM, the script in the click event of the button would be something like:
var d = new Date(); var ThisHour = d.getHours(); if (ThisHour<10) {ThisHour= "0"+ThisHour} var ThisMinute = d.getMinutes(); if (ThisMinute <10) {ThisMinute = "0"+ThisMinute } TimeField1.rawValue = ThisHour + ":" + ThisMinute;
@magdabryla What kind of form is it? PDF or Adaptive?
@Mayank_Gandhi it's pdf.
try this on initialize
var event = new Date();
field.rawValue=event.toLocaleTimeString('en-US');
The code does work, but I did it on enter, not initialize. I've done it because it shouldn't be visible when the document is open. Also it allows me to type my own time.
Thanks!
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies