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
modomodo 

"Required" field status causes unwanted line break with apex:inputfield

I have searched for an answer to this but can seem to find a resolution. I am creating a form in a visualforce page with multiple fields in a custom object. I have created a series of outputlabel tags followed by the associated inputfield tag. The resultant HTML on visualforce works fine as long as the associated field is not marked "required".Whenever I create an inputfield reference to a field with "required" status it creates a line break preceding the field. So this results in an unwanted line break after the outputlabel and prior to the inputfield box. I have tried various combinations of outputpanel etc. but it does not seem to help. Any suggestions would be appreciated. See code snippet below.

 

<apex:page showheader="false" controller="FOFapplicationController" >

<body style="background-color:#ede7dd;">
 
  <apex:form >
    <apex:pageMessages /> <!-- this is where the error messages will appear -->
    
<br/><br/> 
A. General Information: <br/><br/>
1. COMPANY INFORMATION<br/><br/>
  <apex:outputLabel for="app1" value="Applicant Company Name:" />
  <apex:inputField id="app1" value="{!application.Company_Name__c}" required="True" /> <br/> 
Pradeep_NavatarPradeep_Navatar

In my opinion, you have done something wrong in your VF code.This should not happen with  <apex:inputfield>. Can you post the complete code here?