5,696,038 members and growing! (12,546 online)
Email Password   helpLost your password?
Web Development » Client side scripting » Beginners     Advanced

DHTML Calendar control with Time

By Sunil Kumtakar

DHTML Calendar control with Time
Javascript, Windows, Visual Studio, Dev

Posted: 9 Jan 2007
Updated: 9 Jan 2007
Views: 26,476
Bookmarked: 28 times
Announcements
Loading...



Search    
Advanced Search
Sitemap
7 votes for this Article.
Popularity: 2.47 Rating: 2.93 out of 5
1 vote, 14.3%
1
0 votes, 0.0%
2
2 votes, 28.6%
3
1 vote, 14.3%
4
3 votes, 42.9%
5

Sample Image - maximum width is 600 pixels

Introduction

It bring pleasure to present this DHTML Calendar Control with Time.  I have tried to make it as user friendly as possible, so that the user does not struggle while entering the date in your webforms. The other interesting part is it also includes the the interface to capture time.

I have tested it under IE 6, Netscape 8  and Opera 9, and it worked fine. Sorry I couldn't test it with other browser/ Versions.

Though the traditional Calendar display has not been discontinued. Which looks as follows (Clicking the calendar icon next to the Close button brings the traditional Calendar control). As of now it only accept date in dd-MMM-yyyy format.

Using the code

<Input type='text' name="txt21" id="txt21">
<IMG id=btn21 style="WIDTH: 20px; HEIGHT: 14px" 
   height=14 alt="Select Date" src="styles/smcal.gif" 
   width=24>

<script language="javascript"> myCalendar.setup({inputField : "txt21", button : "btn21"}); </script>

The following 2 lines are required under the <head> section of your page.

<LINK href="styles/mycalendar.css" type="text/css" rel="STYLESHEET">
<script src="styles/myCalendar.js" type="text/javascript"></script>

First you are required to place an input control type='text' as in line 1 next place an img control next to it as in line 2(remember to provide a proper value for its ID attribute).

Copy the lines 3 to 5 as it is, and then change the values against the "inputField" and "button" parameters on line 4. Refer to the test.html file in the zip for more help.

Points of Interest

It was really fun writing this script, it gave me a good exposure in javascript, though annoying at times when I used to get stuck in a problems for solving browser incompatiblity.  It was really fun to get the control working under different Browsers.

History

No history as of now.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Sunil Kumtakar


biography
Occupation: Web Developer
Location: India India

Other popular Client side scripting articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 11 of 11 (Total in Forum: 11) (Refresh)FirstPrevNext
Generalneeds validationmemberWill6619:44 28 Mar '08  
GeneralRe: needs validationmemberFelixAlmodovar3:23 29 Jun '08  
GeneralJavascript event calendarmembernbohr99a4:58 9 Sep '07  
QuestionYour calendar js in xsl file.memberyosizack5:34 28 Jul '07  
GeneralImplementing Two Instances of the CalendarmemberTheMadRef9:55 25 Mar '07  
Questionhelp! help! help! undefine myCalendar [modified]memberfuxiurong_200120:44 4 Mar '07  
AnswerRe: help! help! help! undefine myCalendarmemberSunil Kumtakar6:32 5 Mar '07  
QuestionControl is going backmemberramanatha reddy5:11 21 Feb '07  
GeneralMozilla/MAC Compability?memberTheMadRef10:31 25 Jan '07  
GeneralRe: Mozilla/MAC Compability?memberSunil Kumtakar2:39 27 Jan '07  
GeneralGood jobmembershewo19:14 17 Jan '07  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 9 Jan 2007
Editor: Paul Conrad
Copyright 2007 by Sunil Kumtakar
Everything else Copyright © CodeProject, 1999-2008
Web16 | Advertise on the Code Project