![]() |
Web Development »
Client side scripting »
Beginners
Advanced
DHTML Calendar control with TimeBy Sunil KumtakarDHTML Calendar control with Time |
Javascript, Windows, Visual Studio, Dev
|
|
Advanced Search |
|
|
|
||||||||||||||||

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.
<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.
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.
No history as of now.
| You must Sign In to use this message board. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 9 Jan 2007 Editor: Paul Conrad |
Copyright 2007 by Sunil Kumtakar Everything else Copyright © CodeProject, 1999-2009 Web17 | Advertise on the Code Project |