Re: Form Select Selected Choice

2009-09-22 Thread Leonel Nunez
>>> Can you give a more detailed example of your code? >>> >> >> This is what basically I'm doing: >> >> >> class MyForm(forms.Form): >> myfield = forms.CharField(widget=forms.Select) >> >> >> C =[] >> u = User.objects.all() >> for r in u: >> l1 = [] >> l1.append(r.id) >>

Re: Form Select Selected Choice

2009-09-22 Thread Leonel Nunez
>> Can you give a more detailed example of your code? >> > > This is what basically I'm doing: > > > class MyForm(forms.Form): > myfield = forms.CharField(widget=forms.Select) > > > C =[] > u = User.objects.all() > for r in u: > l1 = [] > l1.append(r.id) >

Re: Form Select Selected Choice

2009-09-21 Thread Leonel Nunez
> I too spent a day or so on this seemingly simple problem :( > Here's my solution... > > class EMailAddressForm(forms.Form): > > emailType = forms.ChoiceField(required=True,choices=[]) > > def __init__(self, *args, **kwargs): > super(forms.Form, self).__init__(*args, **kwargs) >

Re: Form Select Selected Choice

2009-09-21 Thread Leonel Nunez
> Can you give a more detailed example of your code? > This is what basically I'm doing: class MyForm(forms.Form): myfield = forms.CharField(widget=forms.Select) C =[] u = User.objects.all() for r in u: l1 = [] l1.append(r.id) l1.append(r.username)

Re: Form Select Selected Choice

2009-09-21 Thread Jim Myers
I too spent a day or so on this seemingly simple problem :( Here's my solution... class EMailAddressForm(forms.Form): emailType = forms.ChoiceField(required=True,choices=[]) def __init__(self, *args, **kwargs): super(forms.Form, self).__init__(*args, **kwargs) choices =

Re: Form Select Selected Choice

2009-09-21 Thread phoebebright
Can you give a more detailed example of your code? On Sep 21, 3:25 am, "Leonel Nunez" wrote: > Hello: > > I'm using > > form.base_fields['MYFIELD'].widget=widgets.Select(choices=CA) > > to fill a   tag, all works fine but I can't find how to add a > SELECTED  value, been

Form Select Selected Choice

2009-09-20 Thread Leonel Nunez
Hello: I'm using form.base_fields['MYFIELD'].widget=widgets.Select(choices=CA) to fill a tag, all works fine but I can't find how to add a SELECTED value, been with this issue all day .. Thank you leonel --~--~-~--~~~---~--~~ You received this