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
chokchok 

How to set Red Bar on Mandatory field for "Name" Field in Visual Force Input Field form.

hi

i want to put red line symbol for mandatory field on vf page

can any one help please

Best Answer chosen by Admin (Salesforce Developers) 
chokchok

First Name <span style="color:red;">|</span> <apex:inputText value="{!first}" required="true"/>

All Answers

Bhawani SharmaBhawani Sharma

use following:

<apex:inputField value="{!Account.Name}" required="true"/>

chokchok

thanks for ur reply i did same thing previously but im not getting red bar

Bhawani SharmaBhawani Sharma
<div class="labelCol requiredInput">
<span class="requiredMark"/>
<apex:inputField value="{!Account.Name}" />
</div>
chokchok

First Name <span style="color:red;">|</span> <apex:inputText value="{!first}" required="true"/>

This was selected as the best answer