Tag Archives: Required Red Bar

Display The Required Bar For apex:selectList in Visualforce Page

Sample Code:

<apex:pageBlockSectionItem>
    <apex:outputLabel value="Group" for="groupSelectList"/>
    <apex:outputPanel styleClass="requiredInput" layout="block">
        <apex:outputPanel styleClass="requiredBlock" layout="block"/>
        <apex:selectList value="{!selectedGroup}" id="groupSelectList" size="1" required="true">
            <apex:selectOptions value="{!groupOptions}"/>
        </apex:selectList>
    </apex:outputPanel>
</apex:pageBlockSectionItem>