I am still having problems setting  the select widget to the 3rd value in the 
drop  down list.
Looking further it seems that the html does not have the selected="selected" 
value in any of the items.
The documentation states that if use a bound form you will see that in the html.
How would you go about getting the selected value in the html for a 
choicefield. I tried the initial parameter in the choicefield and that does not 
change which value is selected. It always happens to be the first in the list.

Any help would greatly appreciated.

Thanks,
Jeff

-------------- Original message -------------- 
From: [EMAIL PROTECTED] 

I must be missing something here because when I change the statement
to status = forms.ChoiceField(required=False, choices=statlist, 
initial="choice3")

it still displays the 1st record in the list when I am trying to have the 3rd 
choice be the selected
value.

Jeff

-------------- Original message -------------- 
From: Thomas Guettler <[EMAIL PROTECTED]> 

> 
> Am Mittwoch, 1. August 2007 15:58 schrieb jeffhg58: 
> > In newforms when I use the choicefield, I haven't been able to figure 
> > out how to set the value to say the third value in the drop down list. 
> > I tried setting the initial=3 but that did not seem to work. 
> > 
> > Here is the definition of the choicefield 
> > 
> > status = forms.ChoiceField(required=False, choices=statlist) 
> 
> Hi, 
> 
> if choices=(("a", "Letter A",) ... 
> 
> you set initial to "a". Simple, isn't it? 
> 
> Thomas 
> 
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to