Posted on 2009-02-17 15:35
Fingki.li 閱讀(2722)
評(píng)論(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可以指定語(yǔ)言 如:<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容器中運(yùn)行完全正常。
Feedback
Two critical files are missed: calendar*.js. we can not run any test without those.
@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
不會(huì)吧,我在這里怎么調(diào)不通呀!你的配置?
我的是eclipse 3.4+tomcat 6.0
不過這代碼好像在html中可以正常顯示喲!
???不是很懂!
@ponlya
若你能在html中正常顯示,為什么會(huì)在容器中不正常呢?(是不是你的容器有問題呀)
另,如果你想用i18n就要注意你的引用包中是否包含 i18n.jsp這個(gè)引用。
我沒有使用i18n 容器也應(yīng)該沒有問題吧!
這里不能粘貼圖片,我把我的問題發(fā)到你的liqingfeng1981@hotmail.com郵箱中去了,希望你有時(shí)間時(shí)幫我看一下……
不甚感謝…………
@ponlya
checkSpecific()是針對(duì)具體應(yīng)用的合法性檢測(cè),自己寫的。
另多注意一下文件間的路徑問題就可以了。
你的郵件己回復(fù)。
好了,錯(cuò)誤如你所說(shuō)!學(xué)弟在這里多謝了……
一運(yùn)行就彈出
Calendar.setup
Nothing to setup(no fielfs found).Please check your code
什么解決啊???
怎樣把文本框fromDate的值傳到時(shí)間控件中呢?