仅在需要时从表单集中显示 django fom
这可能很简单,但无法完成工作。 这是一个模型表单集,使用它可以显示特定的表单数:
formfact = formset_factory(ModelForm,extra = count)
fset = depffact(prefix='new')
我的问题是: 我如何一次显示单个表单,如何修改它以便每次用户 单击按钮,先前的表单将得到验证,并会显示另一个模型表单。 i.,显示 form1,如果要求显示 #2、#3 等,
我尝试跟踪计数并使用该计数,但没有成功。欢迎提出想法
This might be simple but not able to get the work done.
here is a modelformset using which specific # of forms could be displayed:
formfact = formset_factory(ModelForm,extra = count)
fset = depffact(prefix='new')
My question is:
how can i display single form a time,how can i modify it such a way that everytime user
clicks a button previous forms are validated and one more modelform is displayed.
i.,show form1,if asked for show #2,#3 etc
i tried keeping track of count and using that count but was not successful.Ideas most welcome
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我错误地问了两次类似的问题
但我确实在这篇文章中回答了这个问题,以防万一你想参考一下。如果您有更好的解决方案,感谢您分享。
by mistake i asked similar question twice
but i did answer it in this post incase if you want to refer. if you have a better solution, appreciate you sharing it.