posts - 72, comments - 66, trackbacks - 0, articles - 0

JSCalendar 使用样例

Posted on 2009-02-17 15:35 Fingki.li 阅读(2696) 评论(10)  编辑  收藏 所属分类: About development

JSCalendar 日历控件 使用样例如下:

<html>
<head>
    <style type="text/css">@import url( /js/jscalendar/calendar-win2k-cold-1.css );</style>
    <script type="text/javascript" src="/js/jscalendar/calendar.js"></script>
    <script type="text/javascript" src="/js/jscalendar/i18n.jsp"></script>//不用i18n可以指定语言 如:<script type="text/javascript" src="/js/jscalendar/lang/calendar-en.js"></script>
    <script type="text/javascript" src="/js/jscalendar/calendar-setup.js"></script>
</head>
<body>
<input type="text" size="10" name="fromDate" id="fromDate" maxlength="10" onchange="checkSpecific();" value=""/>
<img src="images/icon_calendarpicker.gif" id="fromDateCal" />
<br>
<script type="text/javascript" >
    Calendar.setup(
    {
        inputField  : "fromDate",       // ID of the input field
        ifFormat    : "%m/%d/%Y",       // the date format
        button      : "fromDateCal",    // ID of the button
    });
</script>
</body>
</html>
上述示例代码在jsp容器中运行完全正常。

Feedback

# re: JSCalendar 使用样例  回复  更多评论   

2009-02-18 13:35 by jeasonzhao
Two critical files are missed: calendar*.js. we can not run any test without those.

# re: JSCalendar 使用样例  回复  更多评论   

2009-02-19 15:31 by Fingki.li
@jeasonzhao
What are two critical files what you said ?
I can run the above code.
download resource at http://www.dynarch.com/projects/calendar/
version 1.0 jscalendar-1.0.zip

# re: JSCalendar 使用样例  回复  更多评论   

2009-03-15 21:01 by ponlya
不会吧,我在这里怎么调不通呀!你的配置?
我的是eclipse 3.4+tomcat 6.0

# re: JSCalendar 使用样例  回复  更多评论   

2009-03-15 21:07 by ponlya
不过这代码好像在html中可以正常显示哟!
???不是很懂!

# re: JSCalendar 使用样例  回复  更多评论   

2009-03-16 15:07 by Fingki.li
@ponlya
若你能在html中正常显示,为什么会在容器中不正常呢?(是不是你的容器有问题呀)
另,如果你想用i18n就要注意你的引用包中是否包含 i18n.jsp这个引用。

# re: JSCalendar 使用样例  回复  更多评论   

2009-03-16 19:01 by ponlya
我没有使用i18n 容器也应该没有问题吧!
这里不能粘贴图片,我把我的问题发到你的liqingfeng1981@hotmail.com邮箱中去了,希望你有时间时帮我看一下……
不甚感谢…………

# re: JSCalendar 使用样例  回复  更多评论   

2009-03-17 10:22 by Fingki.li
@ponlya
checkSpecific()是针对具体应用的合法性检测,自己写的。
另多注意一下文件间的路径问题就可以了。
你的邮件己回复。

# re: JSCalendar 使用样例  回复  更多评论   

2009-03-18 10:51 by ponlya
好了,错误如你所说!学弟在这里多谢了……

# re: JSCalendar 使用样例  回复  更多评论   

2011-11-28 17:56 by 陈风
一运行就弹出

Calendar.setup
Nothing to setup(no fielfs found).Please check your code

什么解决啊???

# re: JSCalendar 使用样例  回复  更多评论   

2011-12-20 11:51 by 廖想
怎样把文本框fromDate的值传到时间控件中呢?

只有注册用户登录后才能发表评论。


网站导航: