Activity › Forums › Salesforce® Discussions › What is the difference between <apex:inputfield> and <apex:inputtext> tag in visual force page in Salesforce?
Tagged: Apex InputField, Apex InputText, Field, HTML, Salesforce Objects, Salesforce Visualforce Page
-
What is the difference between <apex:inputfield> and <apex:inputtext> tag in visual force page in Salesforce?
Posted by Pooja on January 28, 2020 at 2:42 PMWhat is the difference between <apex:inputfield> and <apex:inputtext> tag in visual force page in Salesforce?
MOHIT replied 6 years, 3 months ago 3 Members · 2 Replies -
2 Replies
-
Hii Pooja,
apex:inputText: An HTML input element of type text. Use this component to get user input for a controller method that does not correspond to a field on a Salesforce object.
apex:inputField: An HTML input element for a value that corresponds to a field on a Salesforce object. The <apex:inputField> component respects the attributes of the associated field, including whether the field is required or unique, and the user interface widget to display to get input from the user. For example, if the specified <apex:inputField> component is a date field, a calendar input widget is displayed. When used in an <apex:pageBlockSection>, <apex:inputField> tags automatically display with their corresponding output label.
- [adinserter block='9']
-
apex:inputText: An HTML input element of type text. Use this component to get user input for a controller method that does not correspond to a field on a Salesforce object.
This component doesn’t use Salesforce styling. Also, since it doesn’t correspond to a field or any other data on an object, custom code is required to use the value the user enters.
apex:inputField: An HTML input element for a value that corresponds to a field on a Salesforce object. The <apex:inputField> component respects the attributes of the associated field, including whether the field is required or unique, and the user interface widget to display to get input from the user. For example, if the specified <apex:inputField> component is a date field, a calendar input widget is displayed. When used in an <apex:pageBlockSection>, <apex:inputField> tags automatically display with their corresponding output label.
Log In to reply.