There have been many cases where I’ve needed to display various child data pertaining to a parent record. Rather than clutter the page with all the information at once, I like to present the data in tabbed content.
With tabbed content, you can group and display relevant content together with a tab. This makes for better organization of data on the page and potentially keeps the user from having to page down to find the content they are looking for.
The function accepts the date value and a string indicating the format expected (i.e. ‘MDY’). Simply call this function from the form either onChange of the field or on submit of the form. I prefer the on submit approach and check all the fields at once. I find it less annoying that bugging the user on every field change.
First, we’ll go over the basic stand-alone script. This script will count down the days, hours, minutes, and seconds until our target date and time and display that countdown in a div with id=’timer’. For our example the target date and time is December 31, 2050 17:00:00. Once we pass the target date and time the timer will display the literal text “Ended”.