Activity Forums Salesforce® Discussions What is the difference between <apex:inputfield> and <apex:inputtext> tag in visual force page in Salesforce?

  • Marziya

    Member
    January 28, 2020 at 2:50 pm

    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.

  • MOHIT

    Member
    January 28, 2020 at 2:56 pm

    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