You need to sign in to do that
Don't have an account?
St2018
How to show error message underneath <apex:inputTextarea> </apex:inputTextarea>?
On my visualforce page I have this.
<apex:inputTextarea value="{!emp.Job_description__c}" styleClass="form-control"/>
In my controller I have this
if (String.isBlank(emp.Job_description__c)) {
emp.Job_description__c.addError(System.Label.ValidationEmploymentDescription);
doNotsubmit = true;
}
This works for other fields on my visualforce page except for this one.
I have a pageMessage on my page and it has the error message above in a box but not under the field.
The message should be displayed under the field and also above in the pageMessage.
<apex:inputTextarea value="{!emp.Job_description__c}" styleClass="form-control"/>
In my controller I have this
if (String.isBlank(emp.Job_description__c)) {
emp.Job_description__c.addError(System.Label.ValidationEmploymentDescription);
doNotsubmit = true;
}
This works for other fields on my visualforce page except for this one.
I have a pageMessage on my page and it has the error message above in a box but not under the field.
The message should be displayed under the field and also above in the pageMessage.
All Answers
Just try to add required attribute in your inputTextArea like below:
<apex:inputTextarea value="{!emp.Job_description__c}" required="true" styleClass="form-control"/>.
Hope this will help.
Please like the answer and mark it best if this helps.
Thanks,
Aman