+ Start a Discussion
Steve ChadbournSteve Chadbourn 

inputField for Long Text Area not very wide

I'm trying to show a couple of comment boxes using inputField components linked to long text area fields (32,000).
 
Code:
<apex:pageBlockSection title="Other Details" columns="1">
 <apex:inputField value="{!claimNotification.Notifier_Relationship__c}"/>
 <apex:inputField value="{!claimNotification.Notifier_Why_Contact__c}"/>
</apex:pageBlockSection>   

 
I'm showing them in a 1 column pageBlockSection but the rendered textbox is very narrow - about 25% of the width of the section.
 
How do I make the textbox (inputField) wider?
Best Answer chosen by Admin (Salesforce Developers) 
Steve ChadbournSteve Chadbourn

Seems to work fine for an inputField I hooked up to a custom field but I can't get the MailingStreet field of Contact to increase in size at all. Any ideas?

Code:
<apex:pageBlockSectionItem>
 <apex:outputLabel value="Address"/>
 <apex:inputField value="{!contact.MailingStreet}" style="width:95%;"/>
</apex:pageBlockSectionItem>


 

All Answers

jwetzlerjwetzler
since there isn't too much that's special about inputField in the case of text area fields, why not just use inputTextArea instead of inputField, and that way you can specify the cols and rows yourself?  Otherwise you could play around with adding some css for textarea tags and specify your width that way.

Jill
Steve ChadbournSteve Chadbourn

Seems to work fine for an inputField I hooked up to a custom field but I can't get the MailingStreet field of Contact to increase in size at all. Any ideas?

Code:
<apex:pageBlockSectionItem>
 <apex:outputLabel value="Address"/>
 <apex:inputField value="{!contact.MailingStreet}" style="width:95%;"/>
</apex:pageBlockSectionItem>


 

This was selected as the best answer
jwetzlerjwetzler
You can either put this on your page:
Code:
<style>
textarea {
width: 95%;
}
</style>

 or you can use inputTextArea instead of inputField.


Message Edited by jwetzler on 04-02-2008 05:23 PM
Steve ChadbournSteve Chadbourn
Worked a treat - thanks!
code redcode red

jwetzler; thank you for this solution! I've been struggling with this issue for a while and didnt' know I could use <style> for textarea on VF pages. Now the pages in my app look the way I wanted them to!