Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have 6 attachment in a VF page. But the alignment is not right it i coming like this enter image description here

You can see the apex:inputfile in red. I am not able to understand why this is not coming right. Can anybody guide me what i am doing wrong. My VF page code is

<!--Receipt Upload-->
<apex:pageBlock >
<apex:pageBlockSection columns="3" title="Expense Receipt">
    <apex:pageBlockSectionItem >
        <apex:outputLabel value="" for="fileInput" /> 
        <apex:inputFile value="{!attachment.body}" id="fileInput"
          filename="{!}" dir="RTL" accept=".xlsx,.pdf,.docx" size="50" />

    <apex:pageBlockSectionItem >
        <apex:outputLabel value="" for="fileInput1" />
        <apex:inputFile value="{!attachment1.body}" id="fileInput1"
          filename="{!}" dir="RTL1" accept=".xlsx,.pdf,.docx" size="50" />

    <apex:pageBlockSectionItem >
        <apex:outputLabel value="" for="fileInput2" />
        <apex:inputFile value="{!attachment2.body}" id="fileInput2"
          filename="{!}" dir="RTL2" accept=".xlsx,.pdf,.docx" size="50" />

    <apex:pageBlockSectionItem >
        <apex:outputLabel value="" for="fileInput3" />
        <apex:inputFile value="{!attachment3.body}" id="fileInput3"
          filename="{!}" dir="RTL3" accept=".xlsx,.pdf,.docx" size="50" />

    <apex:pageBlockSectionItem >
        <apex:outputLabel value="" for="fileInput4" />
        <apex:inputFile value="{!attachment4.body}" id="fileInput4"
          filename="{!}" dir="RTL4" accept=".xlsx,.pdf,.docx" size="50" />

    <apex:pageBlockSectionItem >
        <apex:outputLabel value="" for="fileInput5" />
        <apex:inputFile value="{!attachment5.body}" id="fileInput5"
          filename="{!}" dir="RTL5" accept=".xlsx,.pdf,.docx" size="50" />
share|improve this question
Looks odd, have you tried 'Inspect(ing) Element' using Chrome to see what's going on with the HTML? This works fine in my browser... – Phil Hawthorn Dec 1 '12 at 14:22
If You have no other option i would suggest using Tr and Td html tags .But this code looks fine for me – Mohith Shrivastava Dec 1 '12 at 17:25
Remove the Dir attribute from the input field component – Avidev9 Dec 2 '12 at 4:12
up vote 8 down vote accepted

It's a case of some delicious copypasta!

The dir attribute only accepts two values. "LTR" and "RTL". "LTR" is the default. Only your first inputFile has a valid value for the dir attribute, so all the others end up being the default "LTR" while the first is "RTL".

Just remove the dir attribute from all of em.

share|improve this answer
awesome. Thanks, I solved it. – AnuRaj Dec 2 '12 at 4:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.