phpcmsV9中表單向導在js調用裏日期控件在IE下報Calendar未定義的解決辦法

最近在phpcmsV9裏用表單嚮導弄個的提交表單,但用了日期和時間類型時,用
 
<script language='javascript' src='{APP_PATH}index.php?m=formguide&c=index&a=show&formid=11&action=js&siteid=1'></script>
 
調用時在IE下報  「Calendar」未定義  的錯誤,導致日期控件沒法使用
 
緣由是由在IE下,calendar.js文件加載沒有阻塞Calendar.setup()方法的運行,Calendar.setup()在calendar.js未加載的狀況,就開始執行了,因此就報出「Calendar」未定義  的錯誤
 
解決辦法:
找到phpcms/libs/class/form.class.php文件
 
在174到182行
 javascript

Calendar.setup({ weekNumbers: '.$showweek.', inputField : "'.$id.'", trigger : "'.$id.'", dateFormat: "'.$format.'", showTime: '.$showsTime.', minuteStep: 1, onSelect : function() {this.hide();} });

改爲:
php

$(function(){ Calendar.setup({ weekNumbers: '.$showweek.', inputField : "'.$id.'", trigger : "'.$id.'", dateFormat: "'.$format.'", showTime: '.$showsTime.', minuteStep: 1, onSelect : function() {this.hide();} }); });
相關文章
相關標籤/搜索