Play Flash Games


© 2007 Red Computer

HTML Howto, CSS Howto, JavaScript Howto, PHP Howto, Windows Howto
Google

Calendar Date Selection Tool


Create calendar date selection tool with JavaScript :

Click at calendar on the right to test

Source code :

<HTML>
<HEAD>
<link rel="stylesheet" href="dynCalendar.css" TYPE="text/css">
<script language="javascript" type="text/javascript" src="browserSniffer.js"></script>
<script language="javascript" type="text/javascript" src="dynCalendar.js"></script>
</HEAD>
<BODY>
<form name=myform>
...
<input type=text name="date_from" size=10 value="2006-02-06" onChange="checkDate(this)" maxlength=10>
<script language="JavaScript" type="text/javascript">
<!--
function eCal(date, month, year) {
    if (String(month).length == 1) {
        month = '0' + month;
    }
    if (String(date).length == 1) {
        date = '0' + date;
    }
    document.forms['myform'].date_from.value = year + '-' + month + '-' + date;
}
calendar1 = new dynCalendar('calendar1', 'eCal');
calendar1.setMonthCombo(true);
calendar1.setYearCombo(true);
//-->
</script>
...
</form>
...
</BODY>
</HTML>

Files that you need are (Right click -> Save target as) :





Visitor's Comment
Post a Comment
Comment
Name :
E-mail :

HOME | HTML | CSS | JavaScript | PHP | XML | SQL | Virus Fix | Windows | Downloads | Links