iFormBuilder JavaScript Tips & Tricks
How do I default an element to the current Date or Time?
To default an element to the current date or time, please follow the instructions below.
When using a Date element, place Date() in the Dynamic Value. It will display on the device as follows:
Dec 6, 2017
When using a Time element, place Date() in the Dynamic Value. It will display on the device as follows:
2:44 PM
When using a Date-Time element, place Date() in the Dynamic Value. It will display on the device as follows:
12/6/17, 2:44 PM
When using a Read-Only element, place Date() in the Dynamic Value. It will display on the device as follows:
Wed Dec 6 2017 10:45:16 GMT-0400 (EDT)
PLEASE NOTE: When using a Date, Time, or Date-Time element on just iOS devices, if you place new Date() in the Dynamic Value, it will work similarly.
iFORM TIP: To keep the user from editing these fields, you can hide them from the user by putting false into the Condition Value of the element.
iOS
Android
Comments
0 comments
Please sign in to leave a comment.