You need to sign in to do that
Don't have an account?
anil kumar devunoori
How to make a selectlist field on visualforce page required and behave similar to object field?
I need to add a selectlist on the vf page which has less number of picklist values than actual picklist on the object. I need to make the selectlist required and when the value is not selected the error message should display just below the select list as displayed for object fields.
- You can find the below link to get the required field css:
- https://developer.salesforce.com/forums/ForumsMain?id=906F000000097boIAA (http://salesforce.stackexchange.com/questions/5462/required-field-mark-red-vertical-bar-not-coming)
- Add a validation at controller side and add it to page messages using ApexPages.addmessages()
Please mark it as best answer if it resolves your problem.Hi anil,
use this bunch of code it will help you. it will make selected list and it will required also if user will not select the value it will give error value is required.