JavaScript Simple Tabbed Content Example

How to use JavaScript to display tabbed content

JavaScript Validate Date ExampleThere 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.
Continue reading “JavaScript Simple Tabbed Content Example”

JavaScript Validate Date Example

How to use JavaScript to validate dates

JavaScript Validate Date ExampleSo often I have a form on the page that includes a date field and I want to validate that date without a round trip to the server. Here is a simple JavaScript function that will do just that.

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.
Continue reading “JavaScript Validate Date Example”

JavaScript Simple Countdown Timer Example

How to create a simple JavaScript Countdown Timer

JavaScript Simple Countdown TimerThis is a simple JavaScript countdown timer I have used many times in the past. This script works great when you need to display the time remaining for a specific activity and have it count down until that time is reached.

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”.

Continue reading “JavaScript Simple Countdown Timer Example”