使用 Django 进行 Pagedown(Markdown 编辑器)
我尝试使用 pagedown(markdown 编辑器),这是我基于 django 的网站中 stackoverflow 的一个。然而,要在文本区域中获取 Markdown 编辑器,需要为文本区域提供 id 和 class,但是
<textarea id="wmd-input" class="wmd-input"/>
django 生成的表单字段的默认 id 为 id_
。有没有办法可以为这个text_area分配相同的id?
I trying to use the pagedown(markdown editor), the one that stackoverflow in my django based website. However to get the markdown editor in a textarea it is required to give the text area both id and class as
<textarea id="wmd-input" class="wmd-input"/>
However the form fields generated by django have a default id as id_<field-name>
. Is there a way I can assign the same id to this text_area?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您也可以在传递类名的 models.py 中直接传递 id 。这将覆盖默认行为。
you can directly pass id as well in the models.py where your are passing class name. This will override the default behavior.