Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试访问隐藏字段的表单值,以便设置或检索它们。
我尝试了该form.field_with()方法,form.fieldname但无法弄清楚如何获取隐藏字段的引用。
form.field_with()
form.fieldname
一般来说,您只需执行以下操作:
form['foo'] = 'bar'
这适用于各种表单字段,而不仅仅是隐藏。