Saturday 15 February 2014

Required Mark on Input Text

If you are using inputText the red bar doesn't come with it. You have to consider inputField and make it required to show the red bar. If you want to show red bar with inputtext then you have to use requireInput css. Below is the code snippet.
 apex:pageBlockSectionItem>  
     <apex:outputLabel value="Name on Card"/>  
         <apex:outputPanel>  
             <div class="requiredInput">  
                 <div class="requiredBlock"></div>  
                     <apex:inputText value="{!name}" label="Name on Card" required="true"/>  
                 </div>  
             </div>  
         </apex:outputPanel>  
 </apex:pageBlockSectionItem>  

No comments:

Post a Comment