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
S PawarS Pawar 

Display default values in apex:inputText tag

Hi

 

How i display default values in apex:inputText tag of visualForce

 

regards,

sagar

 

Best Answer chosen by Admin (Salesforce Developers) 
hitesh90hitesh90

Hi,

 

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';
	}
}

 

 

 

 

Important :
Hit Kudos if this provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.
 
Thank You,
Hitesh Patel
SFDC Certified Developer & Administrator