You need to sign in to do that
Don't have an account?
Ravi kumar 292
How to make Field mandatory in VF Page
Hi all,
I have a scenario, i am using <apex:outputText> to display the custom object fields on a vf page like, FirstName, LastName, DOB, Mobile etc..
My requirement is, i want to display the mandatory field on the vf page.
For example FirstName* or Firstname|(red vertical bar).
Please help on this..
Thanks in advance.
I have a scenario, i am using <apex:outputText> to display the custom object fields on a vf page like, FirstName, LastName, DOB, Mobile etc..
My requirement is, i want to display the mandatory field on the vf page.
For example FirstName* or Firstname|(red vertical bar).
Please help on this..
Thanks in advance.
This code may help you.
Thanks,
Vignesh
All Answers
This code may help you.
Thanks,
Vignesh
Please check the below sample code
Hope this helps you!
Best Regards,
Jyothsna
Fist thing you can not use <apex:outputText> for mandatory field as you can not enter any value for these fields
these are the ways you can do
use <apex:inputField value="{!fieldname}"> and make that field as mandatory on field level
use <apex:inputField value="{!fieldname}" required ="true">
use <apex:inputText value="{!fieldname}" required = "true">
in all the cases you will still red line against field as you required.
let me know, if it helps you or need help :)
shiva.sfdc.backup@gmail.com