admin管理员组文章数量:1401158
tml:
<div id="report-liveonly">
<form action="." id="status" method="POST">{% csrf_token %}
<p>{{SearchKeywordForm.status}}Only show LIVE reports</p>
</form>
</div>
I am trying to submit the searchform on checkbox click.It is not working. Onclick also not happening,i checked with alert message.
The total function is to show the live report,if Only show LIVE reports
checkbox is checked.
Need help
tml:
<div id="report-liveonly">
<form action="." id="status" method="POST">{% csrf_token %}
<p>{{SearchKeywordForm.status}}Only show LIVE reports</p>
</form>
</div>
I am trying to submit the searchform on checkbox click.It is not working. Onclick also not happening,i checked with alert message.
The total function is to show the live report,if Only show LIVE reports
checkbox is checked.
Need help
Share Improve this question edited Jul 24, 2013 at 10:29 user2086641 asked Jul 19, 2013 at 8:20 user2086641user2086641 4,37115 gold badges59 silver badges96 bronze badges 01 Answer
Reset to default 9I found the solution,
class SearchKeyword(Form):
search_keyword = forms.CharField(widget=forms.TextInput(attrs={'placeholder': 'Keyword Search','class':'keyword-search'}))
status = forms.BooleanField(widget=forms.CheckboxInput(attrs={'onclick':'this.form.submit();'}),required=False, label="Status")
本文标签: javascriptsubmit django form on checkbox selectStack Overflow
版权声明:本文标题:javascript - submit django form on checkbox select - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744273949a2598318.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论