You need to sign in to do that
Don't have an account?

How to customise the errors displayes in Sites pages
I have a developed a vf page which has a form in it. And when ever the user does not fill teh reqd fields. the page is getting reloaded. So I added
<apex:pageMessages>
Now I get the error msg displayed on the page top. But this msg is not user understandable. How can I customize this error or just print a neat msg./? I have tried
ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO,'Email is required field')); this in the associated class. But I still the get the same following msg.
Any help is greatly appreciated.
![]() |
Hi ,
The most simple way to edit exception is to make an exception by your own validaion rule in the back code.
Add <apex:pagemessages escape="false" /> at top the of the page
and make sure you don't write required="true" in the VF page field (ex. <apex:inputField value="{!MyFieldToValidate}">)
hope this help!
All Answers
I haven't found any way to customize those errors. If someone else knows of a way I'd love to know!
I think those errors occur when the validation is done at the visualforce level by setting the required attribute to true in the <apex:input>. The only way around this I've found is to set the required attribute to false and do the validation server side then output the error in the controller the way you tried.
Scott
Hi ,
The most simple way to edit exception is to make an exception by your own validaion rule in the back code.
Add <apex:pagemessages escape="false" /> at top the of the page
and make sure you don't write required="true" in the VF page field (ex. <apex:inputField value="{!MyFieldToValidate}">)
hope this help!