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
Dhruv NirgudeDhruv Nirgude 

Label and InputText Regarding query

I am trying to built a VF page. I wrote tags for labels and their input box but i was able to create only Labels not along with their Input Box. here is my VF Tags

<apex:page standardController="contact">
 <apex:form>
    <apex:sectionHeader title="Contact" subtitle="New Contact"/>
    <p> Contacts not associated with accounts are private and cannot be viewed by other  users or included in reports.</p>
    <apex:pageblock title="Contact Edit" Tabstyle="Contact">
   <apex:pageblocksection title="Contact Information"     columns="1" Collapsible="True">
    
       <apex:pageBlockSectionItem>
        <apex:outputLabel value="First Name"/>
        <apex.inputText value="{!Contact.FirstName}"/>
      </apex:pageBlockSectionItem>
       
       <apex:pageBlockSectionItem>
       <apex:outputlabel value="Last Name"/>
       <apex.inputText value="{!Contact.LastName}"/>
    </apex:pageBlockSectionItem>
       
        <apex:pageBlockSectionItem>
            <apex:outputlabel value="BirthDate"/>
            <apex.inputText value="{Contact.birthdate}"/>
    </apex:pageBlockSectionItem>
    </apex:pageblocksection>
                                                                       
    </apex:pageblock>
    </apex:form>
</apex:page>      
Best Answer chosen by Dhruv Nirgude
Vineela ProddaturuVineela Proddaturu
Hi,Dhruv Nirgude
Please,try like this.
<apex:page standardController="Contact">
        <apex:form >
            <apex:sectionHeader title="Contact Edit" subtitle="New Account" />
            <apex:pageBlock title="Contact Edit">
                <apex:pageBlockButtons >
                    <apex:commandButton value="save" action="{!save}"/>
                    <apex:commandButton value="cancel" action="{!cancel}"/>
                </apex:pageBlockButtons>
                
                <apex:pageBlockSection title="{Contact Information}">
                    
                    <apex:inputField value="{!Contact.firstname}"/>
                    <apex:inputField value="{!Contact.lastname}"/>
                    <apex:inputField value="{!Contact.phone}"/>
                    
              </apex:pageBlockSection>      
            </apex:pageBlock>
        </apex:form>
 </apex:page>
           

All Answers

Vineela ProddaturuVineela Proddaturu
Hi,Dhruv Nirgude
Please,try like this.
<apex:page standardController="Contact">
        <apex:form >
            <apex:sectionHeader title="Contact Edit" subtitle="New Account" />
            <apex:pageBlock title="Contact Edit">
                <apex:pageBlockButtons >
                    <apex:commandButton value="save" action="{!save}"/>
                    <apex:commandButton value="cancel" action="{!cancel}"/>
                </apex:pageBlockButtons>
                
                <apex:pageBlockSection title="{Contact Information}">
                    
                    <apex:inputField value="{!Contact.firstname}"/>
                    <apex:inputField value="{!Contact.lastname}"/>
                    <apex:inputField value="{!Contact.phone}"/>
                    
              </apex:pageBlockSection>      
            </apex:pageBlock>
        </apex:form>
 </apex:page>
           
This was selected as the best answer
mukesh guptamukesh gupta
Hi Dhruv,

Please follow below url for more understadning that's will clear you concept

https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_inputField.htm

if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh 
Dhruv NirgudeDhruv Nirgude
Hi Vineela Proddaturu, Thank you for your help it worked. I've one question in your codes  writing lines pattern like you used is manadatory?  
Vineela ProddaturuVineela Proddaturu
Hi Dhruv Nirgude
I think,it is mandatory. can you please, mark it is best answer.