views:

52

answers:

1

I have a modelchoicefield that has too many valid options to really show in a menu. How can I tell Django forms to use another widget that won't take up as much space rendering?

I want to use a HiddenField and I have another widget on the screen taht will populate it. If the hiddenfield has no value I keep getting form validation errors on it even though it is marked as required=false

+2  A: 

All you need to do is use the widget parameter of the form field definition...

But the question really is what other widget would you like to use?

There are some examples of autocomplete widgets. But nothing out of the box.

celopes
For AutoComplete widgets, take a look at http://jannisleidel.com/2008/11/autocomplete-form-widget-foreignkey-model-fields/
googletorp
I want to use a HiddenField and I have another widget on the screen taht will populate it. If the hiddenfield has no value I keep getting form validation errors on it even though it is marked as required=false.
MikeN
Can you post your form and Model?
celopes