2013-07-30
展开全部
demo.htm // demo实例
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head><title>
无标题页
</title>
<script type="text/javascript" src="Calendar.js"></script>
</head>
<body>
<form name="form1" method="post" action="Default3.aspx" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJLTcyMDUyOTIyZGRKyTJtRcvRJ0v4IJi40MBOayccLg==" />
</div>
<div>
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
</div>
<div>
<table border="0px" style="margin:0;padding:0;height:22px;padding:0;" cellpadding="0" cellspacing="0" name="Calendar1" OnInitialzation="__doPostBack('Calendar1','')"><tr><td id="calendar_td" style="border-right:0;"><input id="show_Calendar1" type="text" style="margin:0;padding:0;height:18px;width:130px;" value="2011-01-13" onkeydown="SelectText(event,'show_Calendar1');CanNotDelete(event);" onchange="OnTextChange('show_Calendar1','1');" /></td><td style="border-left:0;"><img src="img/ico.gif" style="height:18px;" onclick="Initiailzation('show_Calendar1','1');" /></td><td style="border-right:0;"><div id="showError_Calendar1" style="height:18px;font-size:12px;color:#FF0000;padding-top:8px;"></div></td><td colspan="3"><div id="calendar_Calendar1"></div></td></tr></table>
</div>
<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
//]]>
</script>
</form>
</body>
</html>
这是前段时间写的一个日历控件,封装成服务器自定义控件了,不过可以直接调用js,以上是js源码和demo实例,已经兼容ie/6/7/8,firefox,safari等主流浏览器,希望对你有帮助,如需要完整源码,请联系
附:js内容过多,无法在这发出来
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head><title>
无标题页
</title>
<script type="text/javascript" src="Calendar.js"></script>
</head>
<body>
<form name="form1" method="post" action="Default3.aspx" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJLTcyMDUyOTIyZGRKyTJtRcvRJ0v4IJi40MBOayccLg==" />
</div>
<div>
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
</div>
<div>
<table border="0px" style="margin:0;padding:0;height:22px;padding:0;" cellpadding="0" cellspacing="0" name="Calendar1" OnInitialzation="__doPostBack('Calendar1','')"><tr><td id="calendar_td" style="border-right:0;"><input id="show_Calendar1" type="text" style="margin:0;padding:0;height:18px;width:130px;" value="2011-01-13" onkeydown="SelectText(event,'show_Calendar1');CanNotDelete(event);" onchange="OnTextChange('show_Calendar1','1');" /></td><td style="border-left:0;"><img src="img/ico.gif" style="height:18px;" onclick="Initiailzation('show_Calendar1','1');" /></td><td style="border-right:0;"><div id="showError_Calendar1" style="height:18px;font-size:12px;color:#FF0000;padding-top:8px;"></div></td><td colspan="3"><div id="calendar_Calendar1"></div></td></tr></table>
</div>
<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
//]]>
</script>
</form>
</body>
</html>
这是前段时间写的一个日历控件,封装成服务器自定义控件了,不过可以直接调用js,以上是js源码和demo实例,已经兼容ie/6/7/8,firefox,safari等主流浏览器,希望对你有帮助,如需要完整源码,请联系
附:js内容过多,无法在这发出来
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询