【问题标题】:Debugging Django调试 Django
【发布时间】:2011-01-18 12:38:32
【问题描述】:

这是一个新手问题。我很难使用 Dynarch 日历小部件将日历小部件添加到我的表单中。我的示例来自弹出示例:http://www.dynarch.com/projects/calendar/doc/

当我单击按钮时,日历不显示。相反,页面会刷新。我不知道这里发生了什么。我不知道这个触发器是否被正确调用。

我的服务器正在接收一个 post 命令。不应该在这里调用任何帖子。我不希望发布任何数据,只希望日历触发器使日历可见。这应该只是加载按钮。

我怎样才能了解这里到底发生了什么?建议?

 <!--- If I look at what's loaded in firebug, the scripts load correctly -->
 <link rel="stylesheet" type="text/css" href="/site_media/css/gold/gold.css" />
 <script type="text/javascript" src="/site_media/js/jscal2.js"></script>
 <script type="text/javascript" src="/site_media/js/en.js"></script>


<form accept-charset="utf-8" method="post" action="" id="edit_activity_form">
  <table>
   <tr><th>Date:</th>

       <td> <input type="text" id="id_activity_date" name="activity_date"> 
       <!-- When I click this button.  The calendar does not appear.  Instead I get a page refresh. -->
       <button id="calendar-trigger">...</button>

       <script type="text/javascript">
          Calendar.setup({
              trigger    : "calendar-trigger",
              inputField : "id_activity_date",
              onSelect   : function() { this.hide() }
          });
       </script></td>
   </td>
 </table>
 <input type="submit" onclick="send_activity_form();return false;" value="save" id="activity_save">
</form>

【问题讨论】:

  • 仅供参考,我认为这与 Django 无关

标签: javascript html firebug


【解决方案1】:

我没有看到函数send_activity_form() 在任何地方定义。

您的 onclick 可能正在调用一个不存在的函数。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-10-24
    • 2011-08-09
    • 2011-04-06
    • 2010-10-28
    • 2015-11-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多