1 > 2 > 3 > 4

View application.



"...struggle with all the ways a user could enter a date..."



Calendar



Calendar



"Calendaring can enhance your application and make it look more professional."

 
Application Description                                     Calendar Article


I was really tired of creating forms for user input and having to struggle with all the ways a user could enter a date... I ended up creating a select box for months and years. But since I did not want to go back to the server to decide what month it was to populate a select box for the days, I had to continue to keep it an input text box. Then I would check that value upon submission. That works great, but I wanted something better.

So, after thinking about the problem, I decided this was a good way to do it. Having the benefit of IE 4.x and IIS, I decided to use a pop-up "box" and build a calendar for the user to select from. My requirements were for it to be small, but readable for the user. It also had to be able to go forward and backwards in time. Since this was for data input, it also had to be on top of everything until the user selected something.

This application shows you how to add calendar functionality to your application. Calendaring can enhance your application and make it look more professional. It also allows you to control how the date is entered without having to put up several form elements to try and force some date convention.

This small application used a few things to make it happen. One object in JavaScript that was important is window.opener. This tells the client to act upon the browser that opened it. Because of the inherent nature of the functionality, the window is made to stay on top until done. So, using JavaScript, the browser stays on top until, and then closes itself when, a day is selected.

Two files are used to show this application:



TestCal.asp
TestCal.asp

TestCal.asp
DateSelect.asp

  1 > 2 > 3 > 4