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
Kent ManningKent Manning 

Edit Page Long Text Area boxes not the right size in visualforce page.

 

I've overwritten the edit page on our contact object with a visualforce page.  I have two 32000 text long fields on this page one called Description (which is a standard field) and another called Additional Notes.  Both of these in the edit screen are very narrow and small.  Does anyone know how to expand these boxes so that they are normal size?  If I use the native edit function they display properly.

 

Here is an excerpt of my code with the offending fields in red. Note that I have tried to sent the columns on the pageblocksection to 1 but that doesn't make any difference.  (A screen shot is below the code).

 

 

<apex:page standardController="Contact"   >
   

    <apex:form >
        <apex:pageBlock title="Contact Edit" mode="edit" >
            <apex:pageBlockButtons >
               <apex:commandButton action="{!Save}" value="Save"/>
               <apex:commandButton action="{!Cancel}" value="Cancel"/>               
            </apex:pageBlockButtons>

           
            
            <apex:pageBlockSection id="OwnerUserData" title="Owners and Users Details" columns="2" >
               <apex:inputField value="{!contact.Prospective_owner_user__c}"/>
               <apex:inputField value="{!Contact.Owner__c}"/>
               <apex:inputField value="{!Contact.Gen_Owner__c}"/>
               <apex:inputField value="{!contact.User__c}" />
               <apex:inputField value="{!contact.Gen_User__c}" /> 

 </apex:pageBlockSection> <apex:pageBlockSection id="OwnerUserData2" rendered="true" columns="1"> <apex:inputfield value="{!contact.Product_s_Used__c}" /> <apex:inputfield value="{!contact.Additional_Notes__c}" /> </apex:pageBlockSection> <apex:pageBlockSection title="Description Information" columns="1"> <apex:inputfield value="{!Contact.Description}" /> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>

 

 

Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard

We've used inline styling for this in the past.

 

E.g.

 

 

<apex:inputField value="{!MyObject__c.MyLongField__c}" style="width:90%"/>
 

 

 

All Answers

bob_buzzardbob_buzzard

We've used inline styling for this in the past.

 

E.g.

 

 

<apex:inputField value="{!MyObject__c.MyLongField__c}" style="width:90%"/>
 

 

 

This was selected as the best answer
Kent ManningKent Manning

Hi Bob_buzzard,

 

Thanks for the quick reply. I gave it a try and it worked like a charm.  Very good to know that the style attribute resoves a multitude of issues with visualforce.