In my opinion, this is an extremely poor design decision. I've never seen drodowns done this way.
Please select
Option 1
Option 2
Is about as universal as it gets.
Please select
Option 1
Option 2
Is weird and untidy.
I'm not creating a custom field type to get rid of an empty field, that's completely unesseary for what is supposed to be a plug and play extension. I've already had to create a seperate database table to store 3 email addresses!
Dropdown list - first option is empty??
Mt drop down field is defined thus:
http://screencast.com/t/ZaERkFHhM4J
The outputted HTML appears like so:
http://screencast.com/t/CNiGStaba
Why is there an empty first option?
Anyone any ideas? Seems like a bug to me.
Comment author was deleted
Hey Dominic,
It's not a bug, first option is empty to avoid having a value selected by default
This is very non standard. Usually 'Please select' or similiar is the first option? Usually we will validate properly? This looks untidy.
Comment author was deleted
Hi Dominic,
Well you can still make the property mandatory so if the user doesn't select an option you will be able to provide some validation text
As an alternative you could create a custom dropdown type that does have an filled first value instead of an empty one
In my opinion, this is an extremely poor design decision. I've never seen drodowns done this way.
Dominic, How would you even create a custom dropddown type? You can't see any xslt for the forms you create.
2012 Thread but one that shows up high in google searches on this topic. I like to put answers for the next person that comes along...
Either in your theme Fieldtypes overide folder or the default forms theme.. In: FieldType.DropDownList.cshtml
You want to add:
And then you want to replace:
With:
Then you can use the default value field on the property in the admin to populate and the value still is 0.
is working on a reply...