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
nivyajnivyaj 

combining all error messages together

I have a VF page with a lot of fields. the requirement is that all the error messages on the fields need to be listed together at the top of the page and have field level error messages. Currently, we have something like this:

 

<apex:inputField value = 'f1' required = true/>
<apex:inputField value = 'f2' required = true/>

 

 

 

When the user clicks submit, and if the values for f1 and f2 are blank, the first field is displayed in the errormessage, and at the field level, there is an error on both saying ERROR- you must enter in a value (at the field level, we want this).

Basically, the requirement is

  1. for the required fields have a red bar
  2. if the fields are not filled in, display field level errors
  3. For all the field level errors, display a message at the top of the page saying the user needs to enter in these values