Activity Forums Salesforce® Discussions What is the difference between inputText and inputField in Salesforce?

  • Suraj

    Member
    May 10, 2017 at 12:26 pm

    Hi Manpreet,

    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.

Popular Salesforce Blogs

Popular Salesforce Videos