Following is the JavaScript Code for the HTML File....the whole file is posted as an attachment please have a look on that for detailed Information...
Script in Head Tag
[code]
function showseldate(obj)
{
if(obj.value!="")
{
seldate.innerHTML="<b>" + parseInt(document.calform.drpmonth.value)+1 + "/" + obj.value + "/" + document.calform.drpyear.value + "</b>";
} }
function changecalendar()
{
var m,y;
m=document.calform.drpmonth.value;
y=document.calform.drpyear.value;
displaycalendar(m,y);
}
function showcurcal()
{
var dt=new Date();
var m,y; m=dt.getMonth(); y=dt.getFullYear();
displaycalendar(m,y);
}
function displaycalendar(m,y)
{
var nod=numofdays(parseInt(m)+1,y);
var wd; var dt=new Date();
var curday=dt.getDate(); dt.setDate(1);
dt.setMonth(m); dt.setFullYear(y); wd=dt.getDay();
clear();
for(var i=1;i<=nod;i++)
{
document.calform.txtday[wd].value=i;
if(i==curday)
{
document.calform.txtday[wd].style.backgroundColor="red";
document.calform.txtday[wd].style.color="white";
}
wd++;
}
}
function clear()
{
for(var i=0;i<42;i++)
{
document.calform.txtday[i].value="";
} }
[/code]
In Body[code]
for(var i=1;i<=6;i++)
{
document.write("tr bgcolor='#FFCC00' >");
for(var j=1;j<=7;j++)
{
document.write("td><div align='center'><input name='txtday' type='text' size='3' onclick='showseldate(this)' readonly></div></td>");
} document.write("</tr>"); }[/code]
--
Thanks and Regards
Meetu Choudhary
Subscribe to:
Post Comments (Atom)
Subscribe via email
MSDotnetMentor
MSDotnetMentor
My Website
http://msdotnetmentor.com
Author
Blog Archive
-
▼
2009
(53)
-
▼
March
(14)
- Silverlight 3- Beta - released
- Creating Calender Using Java Script
- Blinking Text Using JavaScript
- Use a session variable in the class files in c# AS...
- ASP page with database handling
- Keycodes at a glance
- JavaScript String Replace All
- Type Text in Upper Case using CSS
- No scrollbar on HTML web pages - JavaScript code
- Transparent or Hide Scrollbar
- disable scroll bar
- Show or Hide combobox at Runtime using JavaScript
- Sending Email Through ASP.NET using C#
- Overview of ASP.Net Framework
-
▼
March
(14)
its nice but you should also post the html tag of page and calling this javascript function..so it will be useful to newcomer also and anyone can easily undersatnd who has difficulty to use java script and html tag and control...
ReplyDelete