Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

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="{!attachment.name}" dir="RTL" accept=".xlsx,.pdf,.docx" size="50" />
    </apex:pageBlockSectionItem>

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

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

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

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

    <apex:pageBlockSectionItem >
        <apex:outputLabel value="" for="fileInput5" />
        <apex:inputFile value="{!attachment5.body}" id="fileInput5"
          filename="{!attachment5.name}" dir="RTL5" accept=".xlsx,.pdf,.docx" size="50" />
    </apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:pageBlock> 
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
1  
Remove the Dir attribute from the input field component –  Avidev9 Dec 2 '12 at 4:12

1 Answer 1

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

 
discard

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.