Django, setting selected="selected" on a radio input -
A simple form with ModelChoiceField is displayed as a radio button (inherited widget).
A change event for each post I am using, each user selects a radio button:
shipping_choice = shippingChoiceField (queryset = ShippingMethods.objects. All), empty_labil = none, widget = forms.RadioSelect (attrs = {'Class': 'order', 'onchange': '$ ("# shipping_choice"). Submit ()',})))
I need the radio that the user selected thought, the page is actually "selected" when reloaded.
Adding an additional 'ARR' selected will not be, 'because it should be done when users actually make the first option. P
Form has a initial
attribute that you can use:
Comments
Post a Comment