You need to sign in to do that
Don't have an account?
"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/>
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?