You need to sign in to do that
Don't have an account?
chenna1234
Displaying custom error message on vf page if field is not filled
Hi All, I kept required=" true" only vf page where it shows red mark on it. but i need to display custom error message on top of vf page if field is not filled.....
Three things:
1. You need to use the <apex:pagemessages /> tag near the top of your page so that errors are displayed.
2. You probably don't want to use required="true" because the error message that is returned is not configurable. If you add your own custom save() method, you can return a good error message using these techniques:
http://www.salesforcefast.com/2011/06/make-easy-to-use.html
3. If you don't use the required="true" attribute, you can use this technique to set up the red bar to indicate a required field:
http://www.salesforcefast.com/2010/07/displaying-required-fields-in.html
All Answers
Three things:
1. You need to use the <apex:pagemessages /> tag near the top of your page so that errors are displayed.
2. You probably don't want to use required="true" because the error message that is returned is not configurable. If you add your own custom save() method, you can return a good error message using these techniques:
http://www.salesforcefast.com/2011/06/make-easy-to-use.html
3. If you don't use the required="true" attribute, you can use this technique to set up the red bar to indicate a required field:
http://www.salesforcefast.com/2010/07/displaying-required-fields-in.html