如何在外部JavaScript中调用函数?

时间:2014-03-04 11:35:34

标签: c# javascript asp.net

我正在尝试日历..该方法正在调用,但内容不是。我无法弄清楚问题是什么。可以有人帮我请 我使用了以下的javascript函数。

function showCalendar(id, format, showsTime, showsOtherMonths) {
  alert('calender')
  var el = document.getElementById(id);
  if (_dynarch_popupCalendar != null) {
  _dynarch_popupCalendar.hide(); // so we hide it first.
  } else {
    var cal = new Calendar(1, null, selected, closeHandler);
    if (typeof showsTime == "string") {
      cal.showsTime = true;
      cal.time24 = (showsTime == "24");
    }
    if (showsOtherMonths) {
      cal.showsOtherMonths = true;
    }
    _dynarch_popupCalendar = cal; // remember it in the global var
    cal.setRange(1900, 2200); // min/max year allowed.
    cal.setDisabledHandler(isDisabled);
    cal.create();
  }
  _dynarch_popupCalendar.setDateFormat(format); // set the specified date format
  _dynarch_popupCalendar.parseDate(el.value); // try to parse the text in field
  _dynarch_popupCalendar.sel = el; // inform it what input field we use
  _dynarch_popupCalendar.showAtElement(el, "Br"); // show the calendar
  return false;
}

我在文本框之后调用了函数..

<div class="flt">
From Date&nbsp;  
        <asp:TextBox ID="From_calendar" runat="server" class="dateinput"/></div>
                      <img src="Images/Calendar_icon.gif" style="cursor:pointer" class="flt" alt="Select date" onclick="return showCalendar('From_calendar','%d/%m/%Y');" />
                 </div>

0 个答案:

没有答案