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
RahulRahul 

Hello friends, Iam rendering a input field based on Picklist condition. Its working but they are not displayed with proper styling. Need your Help

User-added image
My Code :-

<apex:inputField value="{!buck1.Aadhar_Number__c}" required="true"/>
<apex:inputField value="{!buck1.CBIL__c}" required="true"/>
 
<apex:actionRegion >
<apex:pageBlockSectionItem >

 <apex:outputLabel >Do you Have Loans? :</apex:outputLabel>

<apex:inputField value="{!Bucket1__c.Do_you_have_Loans__c}">
    <apex:actionSupport action="{!null}" event="onchange" reRender="myform" />
    
    </apex:inputfield>
</apex:pageBlockSectionItem>
     </apex:actionRegion>

<apex:pageBlockSectionItem >

  <apex:outputPanel id="myform" > 
         <apex:outputPanel rendered="{!IF(Bucket1__c.Do_you_have_Loans__c== 'Yes', true,false)}" >
                <apex:outputLabel >EMI Per Month</apex:outputLabel>

       <apex:inputField value="{!Bucket1__c.EMI_Per_Month__c}"   ></apex:inputField>

       
       </apex:outputPanel>

  
       </apex:outputPanel> 
</apex:pageBlockSectionItem>





 
Andrew GAndrew G
The issue will be in how the output panel is displaying within the pageblock/section/item
To get the formating try something like:

note that we are trying to match the layout from one pageBlockSectionItem to the next i.e. outputLabel is the first to follow, so it picks up the formatting in the pageBlockSectionItem first. 
Also move the actionRegion to tighten around the field that is doing the change(action).

Its not perfect , but may help.
<apex:page standardController="Account" showHeader="true" sidebar="true">
    <apex:form>
        <apex:pageBlock>
            <apex:pageBlockSection title="Section one" columns="2">
                <apex:inputField value="{!Account.Name}" required="true"/>
                <apex:inputField value="{!Account.Industry}" required="true"/>
                <apex:pageBlockSectionItem >
                    <apex:outputLabel >Are you active? :</apex:outputLabel>
                    <apex:actionRegion >
                        <apex:inputField value="{!Account.Active__c}">
                            <apex:actionSupport action="{!null}" event="onchange" reRender="myform" />
                        </apex:inputfield>
                    </apex:actionRegion>
                </apex:pageBlockSectionItem>
                <apex:pageBlockSectionItem>
                    <apex:outputLabel >Account source :</apex:outputLabel>
                    <apex:outputPanel id="myform" layout="block" >  
                        <apex:outputPanel rendered="{!IF(account.Active__c== 'Yes', true,false)}" >
                            <apex:inputField value="{!account.AccountSource}"   />
                        </apex:outputPanel>
                   </apex:outputPanel>
                </apex:pageBlockSectionItem>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Regards
Andrew