How do I get the selected value from a form's ComboBox field? what is the model class that deals with ComboBoxes? ..
Thanks.
How do I get the selected value from a form's ComboBox field? what is the model class that deals with ComboBoxes? ..
Thanks.
There's no such thing as a ComboBox in Django (or in HTML). I assume you are talking about a ChoiceField
, which renders a select
control in HTML.
You access the value of a ChoiceField in exactly the same way as any other field, once the form has been submitted and validated - by accessing form.cleaned_data['fieldname']
.
You should read the excellent documentation on forms.