You need to sign in to do that
Don't have an account?
TehNrd
Need help with adding the little red required bar
Adding the red required bar to an inputField is easy as when you make the field required it automatically adds the bar. Yet I am having trouble with other components such as selectList or inputText. Even if you make these required the red bar does not automatically show up so I am assuming this must be done manually with styling.
Unfortunately for me I'm not too crafty with styling (still learning) so any help is appreciated.
Thanks,
Jason
Unfortunately for me I'm not too crafty with styling (still learning) so any help is appreciated.
Thanks,
Jason
If you want to display it for something else, this is the html inputField actually prints out:
As usual, you use our CSS styles at your own risk! Otherwise you could code up your own style that does the same thing.
Also, is there anyway to define custom error messages as this isn't that user friendly....
Page Code:
Thanks,
Jason
If this was for a published app I would (and will) definitely move that logic to the controller so the output can be nice and clean. Since this is internal only I think I will just leave it for the time being as the user still knows to fill in the field, regardless of how it looks.
-Thanks
Jason
The most simple example I could come up with to make a pick list required inside of a pageBlockSectionItem. Please note that the pageBlockSectionItem can only have 2 children. Therefore you have to write the pick list and the tags that make it required in an <apex:outputPanel> tag.
<apex:pageBlockSectionItem id="mySectionItem1">
<apex:outputLabel value="myLabel" for="listBelow" />
<apex:outputPanel>
<div class="requiredInput">
<div class="requiredBlock"></div>
<apex:selectList id="listBelow" value="{!myObj__c.Field__c}" size="1" required="true">
<apex:selectOptions value="{!myOptions}" />
</apex:selectList>
</div>
</apex:outputPanel>
</apex:pageBlockSectionItem>