You need to sign in to do that
Don't have an account?
JeriMorris
inputText with required="true" doesn't generate a required field
I have a page that defines an inputText component with required="true" but when the page renders, the input box doesn't have the red bar indicating that it's required.
My page looks like this:
When the page is displayed, the vertical red "required" bar doesn't precede the input box.
If I add a Save button to the page and click it, the field does act as if a value is required. (Contact.Birthdate is required in my org). The problem is that the UI doesn't display the "required" visual cue.
This is pretty simple stuff. What am I doing wrong?
Jeri
My page looks like this:
<apex:page standardController="Contact"> <apex:form > <apex:outputLabel value="Birthdate" /> <apex:inputText value="{!Contact.birthdate}" required="true" /> </apex:form> </apex:page>
When the page is displayed, the vertical red "required" bar doesn't precede the input box.
If I add a Save button to the page and click it, the field does act as if a value is required. (Contact.Birthdate is required in my org). The problem is that the UI doesn't display the "required" visual cue.
This is pretty simple stuff. What am I doing wrong?
Jeri
and yes i can use my custom styles or simply copy existing salesforce styles so even if salesforce make changes in underlying look and feel section i will be having working but old looking salesforce page.
thanks
All Answers
I need inputText instead of inputField because I don't want the date-picker functionality that inputField would give me. In fact, the page really looks more like this:
and the controller implements getAValue() and setAValue() methods.
My problem is that the inputText component's required attribute doesn't render as required.
Hope this will solve your problem and if you got any better solution then don't forget to post.
thanks
Any word from Salesforce as to whether this is a bug in the inputText component? If so, if the bug is fixed, I'll wind up with two red vertical bars, right?
Jeri
Such as this one
And as always you use salesforce stylesheets at your own risk. We can and do change them often. If you want a similar red bar next to your required fields it might be better to define your own css classes.
and yes i can use my custom styles or simply copy existing salesforce styles so even if salesforce make changes in underlying look and feel section i will be having working but old looking salesforce page.
thanks
Hi i get the exact red bar and if the user does not enter any data i want to display error like inputfield Plz help me