The question pretty much says it all. I'm trying to change the default 'Select Options' text on a TypedMultipleChoiceField in my form. I've tried empty_value, widget title and looked through the Django docs but no luck. I'm not trying to set an initial value because the form is rendered through a formset so most of the time there are already selected options. Also, choices are set at runtime because the choice is dependent upon a fk. Any help would be awesome as I've spent more time than I'd like to admit trying to figure this out.
Asked
Active
Viewed 119 times
2
-
Did you try `empty_label` attribute? Oh, looks like it's only on `ModelChoiceField`, not sure if it would work here. – Rohit Jain Dec 15 '15 at 18:06
-
@RohitJain Sadly, Django doesn't allow empty_label on a TypedMultipleChoiceField for some reason. – Obj3ctiv3_C_88 Dec 15 '15 at 18:11
-
Can you try this: http://stackoverflow.com/a/14032358/1679863 – Rohit Jain Dec 15 '15 at 18:13
-
@RohitJain I don't believe that actually changes what is at top so the only way to display it is to set it as the init value which would mess with the way I clean the form data if someone doesn't uncheck it. – Obj3ctiv3_C_88 Dec 15 '15 at 18:17
-
It does.. If you see closely, the second part is getting the list starting from index 1 - `[1:]`? – Rohit Jain Dec 15 '15 at 18:19