Is there a way to set the initial or default value in the
ChoiceField? I need to set a default Country.
For example:
country = forms.ChoiceField(label='Country',
choices=[(c.id,c.name) for c in
Countrylist.objects.all()],
def
Use the 'initial' keyword arg:
http://www.djangoproject.com/documentation/newforms/#initial
--
Jeff Bauer
Rubicon, Inc.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group,
I put in initial as a parameter. In the drop down list, or radio
button, it does not highlight it anyway when you are at the page. If
I look at the view source, it says, selected for drop down list and
checked for radio button. Any idea why?
On Feb 27, 5:50 pm, "Rubic" <[EMAIL PROTECTED]> wrot
It's working now. Thank you.
On Feb 27, 8:52 pm, "johnny" <[EMAIL PROTECTED]> wrote:
> I put in initial as a parameter. In the drop down list, or radio
> button, it does not highlight it anyway when you are at the page. If
> I look at the view source, it says, selected for drop down list and
>
4 matches
Mail list logo