[SalesForce] How to make a picklist input field as required in a Visualforce page

Making a picklist field as required means to remove the --None-- option.

A picklist cannot be made required in the field setup.

In a standard detail page, a picklist can be made required by checking the Required checkbox in the page layout. This removes the --None-- option from the picklist options.

However, in a Visualforce page, an picklist cannot be made required with required="true", even if the picklist has a default value specified in setup.

How to make a picklist input field as required in a Visualforce page?

I do not want to resort to dirty Java Script code unless there is no other solution.

Best Answer

With the new Winter 17 release existing custom picklist fields can now be marked as required at a field level.

enter image description here

To create or modify custom picklists:

Picklist on an object — Use the fields area of the object.

Global picklist — From Setup, enter picklist in the Quick Find box, then select > Picklists.

Taken from the release notes for Winter 17.