本文介绍了仅包含月份和年份的日历的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个可以正常使用的日历,但是现在我想要的是单击日历时只显示月份和年份的日历.
我现在正在做的是

Hi,
I have a calender which works fine,but what I want now is the Calender to show only Month and Year when clicked on it.
What I am doing now is

 <script type="text/javascript">
var textboxStartDate = ["txtbox1"];
function keyDown() {

    var key;
    if (navigator.appName == 'Microsoft Internet Explorer')
        key = event.keyCode;
    else
        key = event.which
    if (key == -1 || key == 8) {

        for (var index = 0; index < textboxStartDate.length; index++) {
            if (textboxStartDate[index] == sender.get_id()) {
                var text = $find(textboxStartDate[index]);
                if (text != null) {
                    document.getElementById(text).value = "";
                }
            }
        }
        event.returnValue = true;
    }
    else {
        alert("Select from Calendar!");
        event.returnValue = false;
    }

</script>

并在文本框中的键盘按下时调用此函数.此函数显示日期,月份和年份.但是,我只想要月份和年份.
谢谢

and calling this function on keydown in textbox.This function displays Date, Month and Year. But, I want is only Month and Year.
Thanks

推荐答案

并在文本框中的键盘按下时调用此函数.此函数显示日期,月份和年份.但是,我只想要月份和年份.
谢谢

and calling this function on keydown in textbox.This function displays Date, Month and Year. But, I want is only Month and Year.
Thanks



var cal1;
                  var cal2;

                  function pageLoad() {
                      cal1 =


这篇关于仅包含月份和年份的日历的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-29 02:40