【问题标题】:Using twitter bootstrap with Django forms将 twitter 引导程序与 Django 表单一起使用
【发布时间】:2013-11-06 16:33:30
【问题描述】:

我想在将工具提示提供给浏览器后将其附加到我的输入字段。我正在使用以下内容,但它没有进入我打印“Inside eventID javascript”的第二个函数

我这样做是因为在我的模板中我使用 {{ fields }} 标签来显示输入字段。如果我指定 html 标记,则不会显示模型中指定的默认值。

<script type = "text/javascript">
$(function (){
   console.log("Test");
   $('#id_eventID').onfocus = function () {
    console.log("Inside eventDI javascript");
    $(this).tooltip({title:"helloooo!"});
    }
});
</script>

【问题讨论】:

    标签: twitter-bootstrap django-models django-forms django-templates


    【解决方案1】:

    如果你想在 Django 中使用引导程序,我建议使用 https://github.com/dyve/django-bootstrap3 (V3) 或 https://github.com/dyve/django-bootstrap-toolkit (V2)。

    关于工具提示:为什么不使用 tooltip.js http://getbootstrap.com/javascript/#tooltips

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-06-06
      • 1970-01-01
      • 1970-01-01
      • 2013-03-26
      • 2013-05-26
      • 2013-01-05
      相关资源
      最近更新 更多