You need to sign in to do that
Don't have an account?
Nandhini S 3
How to display default values in <apex:input text> tag?
I have a requirement to display username format in the username field.
ex: Username: <abc@abc.com>
Username field should have a default value which shows the format the user should enter. I'm not able to do that...can someone help out here.
<apex:pageMessages id="error"/> <label>Username</label> <apex:inputText value="{! username }" onkeypress="return noenter(event)" styleClass="input r4 wide mb16 mt8 username"/>
ex: Username: <abc@abc.com>
Username field should have a default value which shows the format the user should enter. I'm not able to do that...can someone help out here.
<apex:pageMessages id="error"/> <label>Username</label> <apex:inputText value="{! username }" onkeypress="return noenter(event)" styleClass="input r4 wide mb16 mt8 username"/>
If this answer helps you, please mark it as accepted.
Regards,
Tushar Sharma
https://newstechnologystuff.com/
All Answers
Below is the sample Example for your requirement.
Visualforce Page:
<apex:page controller="defaultvalue">
<apex:inputText value="{!strDefault}"/>
</apex:page>
Apex Class:
Public class defaultvalue{
Public string strDefault {get; set;}
public defaultvalue(){
strDefault = 'Test Default';
}
}
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks.
If this answer helps you, please mark it as accepted.
Regards,
Tushar Sharma
https://newstechnologystuff.com/