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
David Kingery 3David Kingery 3 

How to restrict the width of a multi-picklist inputField on a Visualforce page (standard controller)

Multi-picklist is too wide to fit on the visual force page

So, I have a Visualforce page that's more or less replacing the entire record page for several reasons, mostly to conditionally show/hide fields.

There's about a hundred or so <apex:inputField> tags, of picklist, text, and multipickist types.  Many of the picklist and multipicklist have very long answers, so the width of the field dynamically expands beyond the borders edges of the Visualforce page, and even off my end user's low-resultion laptop screens.

I've tried replacing them with <apex:selectList> and <apex:selectCheckboxes>, but besides other formatting issues, these won't update the SObject via the standard controller as needed (value needs to be "{!Custom_Object__c.Custom_Field__c}", or else load/save and show/hide functionality won't work).

I've tried style="width:40px" and style="width:10%" (with different values) and the markup seems to ignore them altogether.

How do I force a multipicklist to stay within the boudaries of it's visualforce page?
Raj VakatiRaj Vakati
Try this styles. Meanwhile can you share the peace of code for multi-select picklist ​
style="height:auto;width:auto !important;"
David Kingery 3David Kingery 3
Thanks, I tried that before but without !important, unfortuantely adding it didn't solve the issue.
<apex:inputField label="" value="{!Custom_Object__c.Cust_Multi_Picklist_Field__c}" style="height:auto;width:auto !important;">
			<apex:actionSupport event="onchange"  rerender="conditionalField" status="Stage"/>
		</apex:inputField>