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
dai tran 6dai tran 6 

Why inputfield not allow input data?

Code of Visualforce Page:
Show old contact infor of user and allow user edit (if not correct).   
                <tr><td>Sex:</td><td><apex:inputfield label="" value="{!contact.Salutation}" /></td></tr>
                <tr><td>First Name:</td><td><apex:inputfield label="" value="{!contact.FirstName}" /></td></tr>
                <tr><td>Last Name:*</td><td><apex:inputfield label="" value="{!contact.LastName}" /></td></tr>
                <tr><td>Email:*</td><td><apex:inputfield label="" value="{!contact.Email}" /></td></tr>          
                <tr><td>Phone:</td><td><apex:inputfield label="" value="{!contact.Phone}" /></td></tr>
                <tr><td>Street:</td><td><apex:inputfield label="" value="{!contact.MailingStreet}" /></td></tr>
                <tr><td>City:</td><td><apex:inputfield label="" value="{!contact.MailingCity}" /></td></tr>
                <tr><td>State:</td><td><apex:inputfield label="" value="{!contact.MailingState}" /></td></tr>
                <tr><td>Country:</td><td><apex:inputfield label="" value="{!contact.MailingCountry}" /></td></tr>
                <tr><td>PostalCode:</td><td><apex:inputfield label="" value="{!contact.MailingPostalCode}" />                </td></tr>

Result it display old information, but not allow input data.
Why inputfield not allow input data?
 
NagendraNagendra (Salesforce Developers) 
Hi Dai,

May I request you please elaborate your requirement so that we can understand better and can help you accordingly.

What is that you are trying to achieve and what exactly is the problem you are facing.

Assuming that you want to input the data using input field and want to save the new record information to the database.

If that's the use case then below piece of code works fine.
<apex:page standardController="contact" >
   
      
    <apex:form >
        <apex:commandButton action="{!save}" value="save"/>
                    <tr><td>Sex:</td><td><apex:inputfield label="" value="{!contact.Salutation}" /></td></tr>
                <tr><td>First Name:</td><td><apex:inputfield label="" value="{!contact.FirstName}" /></td></tr>
                <tr><td>Last Name:*</td><td><apex:inputfield label="" value="{!contact.LastName}" /></td></tr>
                <tr><td>Email:*</td><td><apex:inputfield label="" value="{!contact.Email}" /></td></tr>          
                <tr><td>Phone:</td><td><apex:inputfield label="" value="{!contact.Phone}" /></td></tr>
                <tr><td>Street:</td><td><apex:inputfield label="" value="{!contact.MailingStreet}" /></td></tr>
                <tr><td>City:</td><td><apex:inputfield label="" value="{!contact.MailingCity}" /></td></tr>
                <tr><td>State:</td><td><apex:inputfield label="" value="{!contact.MailingState}" /></td></tr>
                <tr><td>Country:</td><td><apex:inputfield label="" value="{!contact.MailingCountry}" /></td></tr>
                <tr><td>PostalCode:</td><td><apex:inputfield label="" value="{!contact.MailingPostalCode}" />                </td></tr>
    </apex:form>
  
</apex:page>
Please let us know if you are looking for something else.

Happy to help further.

Thanks,
Nagendra
dai tran 6dai tran 6
I want display information of Contact of a Account and allow user edit.
Ex: <apex:inputfield value="{!contact.FirstName}" />
But result display on website is a Label (not textbox) , So user can't input a new FirstName  if user want edit.