function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
kenzokenzo 

Need to ensure PickList NOT EMPTY (i.e. --None Selected--) in VF Page

Hello. I'm creating a VF page and incorporating a PickList Field from a Custom Object.  I've set the Validation Rule to ensure that the field isn't empty but that only works from within Salesforce. 

 

I need to ensure a value is selected from the PickList when an end user is entering a record through the VisualForce page.

 

FYI: Text fields that are marked as Required DO spawn the appropriate Error Msg if they are left blank.

Message Edited by kenzo on 02-09-2010 03:57 PM
Best Answer chosen by Admin (Salesforce Developers) 
TehNrdTehNrd
required="true" attribute on the apex:selectList or apex:inputField. I would use inputField if you can.

All Answers

TehNrdTehNrd
required="true" attribute on the apex:selectList or apex:inputField. I would use inputField if you can.
This was selected as the best answer
kenzokenzo

Awesome!!  Many thanks, my friend. 

 

Like so much in life the answer was incredibly simple... as long as you knew what it was!  :)

BharathwajBharathwaj

Hi People,

 

Can you give me some idea if we are to make a field mandatory through Visual Force in Standard Page, like in a Lead page or an Opportunity Page. 

 

Regards,

Bharath

Message Edited by Bharathwaj on 02-11-2010 06:41 AM