use*_*945 95 django django-templates django-forms
有没有办法在模板中获取字段的ID?
在我得到的HTML中: <input name="field_name" id="id_field_name"...
我知道我可以得到这个名字{{ field.html_name }},但有什么类似的获得身份证?
或者我可以这样得到它:id_{{ field.html_name }}?
Wil*_*rdy 161
你可以得到这样的ID:
{{ field.auto_id }}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
46176 次 |
| 最近记录: |