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
DannyK89DannyK89 

Input secret required red line

I have a visual force page that has a apex:inputsecret and I made it requried. However the red bar that normaly is at the front of the field is not there. Is there a way to make the red bar show up. Is the red bar not showing up becuase it is a inputsecret tag?

Best Answer chosen by Admin (Salesforce Developers) 
vhanson222vhanson222

Whenever i have a field that should be displayed as required on a VF page, i use a variation of the code below:

 

 

<apex:pageBlockSectionItem >
    <apex:outputLabel value="Password" />
    <apex:outputPanel styleClass="requiredInput" layout="block" id="pwPanel" >
        <apex:outputPanel styleClass="requiredBlock" layout="block"/>
        <apex:inputField value="{!aPassword}" id="aPassword" />
    </apex:outputPanel>
</apex:pabeBlockSectionItem>

 hope that helps

 

All Answers

vhanson222vhanson222

Whenever i have a field that should be displayed as required on a VF page, i use a variation of the code below:

 

 

<apex:pageBlockSectionItem >
    <apex:outputLabel value="Password" />
    <apex:outputPanel styleClass="requiredInput" layout="block" id="pwPanel" >
        <apex:outputPanel styleClass="requiredBlock" layout="block"/>
        <apex:inputField value="{!aPassword}" id="aPassword" />
    </apex:outputPanel>
</apex:pabeBlockSectionItem>

 hope that helps

 

This was selected as the best answer
DannyK89DannyK89

Thanks it worked great.