+ Start a Discussion

The red bar used for Required Fields




I currently developing certain wizards that include fields that need to be set as required and some that need to be conditionally set as required. I am using Javascript to set the fields accordingly, those that need to be conditionally set as required. My question is, is there some way I can replace the red bars with asterisks?


Barring that, is there some way to set the red bar in case of those fields that are being set as required using Javascript?



Message Edited by Azsharael on 03-10-2009 06:33 AM
Best Answer chosen by Admin (Salesforce Developers) 

I was able to get this to work by adding two OutputPanel tags using the RequiredInput and RequiredBlock StyleClass values. In the code below, the two lines above the<Apex:SelectList> are used to add the red bar. The first outputPanel wraps around the selectList. The second outputPanel tag is a single line (note the / at the end).



<apex:pageBlockSectionItem id="ToUser">
<apex:outputLabel >Transfer To User:</apex:outputLabel>
<apex:outputPanel layout="block" styleClass="requiredInput">
<apex:outputPanel layout="block" styleClass="requiredBlock"/>
<apex:selectList value="{!toUserID}" size="1" required="true" id="toUserID">
<apex:selectOptions value="{!ToUsers}"></apex:selectOptions>