Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form action="" method="POST" novalidate>
- {% csrf_token %}
- {% for choice in choices %}
- <input type="radio" name="fruit" style="margin-left: 300px" value="test1" checked> Low
- <input type="radio" name="fruit" style="margin-left: 900px" value="test2" checked> High<br>
- {% endfor %}
- <br>
- </form>
- def selector(request):
- if request.method == 'POST':
- form = Selector(request.POST)
- if form.is_valid():
- cd = form_cleaned_data['profile']
- return render(request, 'app/selector.html', {'form': form})
- return render(request, 'app/selector.html')
- SCORES = [('low','Low'),]
- class Selector(forms.Form):
- ranking = forms.ChoiceField(choices=SCORES, widget =
- forms.RadioSelect)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement