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

How to display error message on right side of inputText.
Hi,
I have inputText component for accepting input.
If user not fills any value I want to display error message to right side of this field.
I made required = true but it displays error message on top of page.
Here is code,
<apex:inputText id="username" value="{!username}" styleClass="textSmall" required="true"/>
Could you please help me to get through this.
Regards,
Pratty
public class CustomAccount{
public static void isAccountExist(Custom_Account__c[] account) {
System.debug('inside isAccount');
System.debug('Array First Element------>' + account[0].Name );
List<Custom_Account__c> list1 = [select Name from Custom_Account__c where Name =:account[0].Name];
System.debug('value of ------->' + list1.size());
if(list1.size()> 0)
{
System.debug('user already exist');
account[0].Name.addError('AccountName Already Exist, Please use another name');
}
else
{
System.debug('new entry Testing');
}
}
}
Hi,
Thanks for reply but I want that error message for "inputText" component.
Here's is complete code.
// controller
public string username {get;set;}
// Page
<apex:inputText value="{!username}" />
if I used addError method for username it shows error message that it's only used for sObject fields.
Regards,
Pratty