Reputation: 4371
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
Upvotes: 2
Views: 3528
Reputation: 4371
I 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")
Upvotes: 9