You need to sign in to do that
Don't have an account?

Want to remove current date link from inputField for a date
My VF page has an inputField component for a date field that represents someone's birthdate. The HTML that gets generated from this includes a link that allows the user to select the current date. For birth dates, it's pretty rare that this link is useful. Is there any way to remove the link, but still keep the rest of the date picker functionality?
For what it's worth, I tried defining this style sheet rule:
.hideDateFormat a {display:none;visibility:hidden;}
and adding this to the inputField tag:
styleClass="hideDateFormat"
This successfully hides the date link, but not the square brackets that surround the link, so what I'm left with is a text entry field (which the user an click to invoke the date picker), followed by empty square brackets. I can't figure out how to remove the brackets.
Thanks,
Jeri
For what it's worth, I tried defining this style sheet rule:
.hideDateFormat a {display:none;visibility:hidden;}
and adding this to the inputField tag:
styleClass="hideDateFormat"
This successfully hides the date link, but not the square brackets that surround the link, so what I'm left with is a text entry field (which the user an click to invoke the date picker), followed by empty square brackets. I can't figure out how to remove the brackets.
Thanks,
Jeri
The problem I see with this is that if you have any other output/input fields that use this styling they won't show up. For me this isn't a issue as the only type of field my page has is a date input field.
All Answers
The problem I see with this is that if you have any other output/input fields that use this styling they won't show up. For me this isn't a issue as the only type of field my page has is a date input field.
Yeah, I figured that out too, and realized that it had the limitation you described -- it causes the link to disappear for all date inputFields on the page. That's why I tried playing with my own CSS class, which I can use for specific date fields only. Using that class, I can get the link to disappear, but I can't figure out how to get the class applied to the span that contains the square brackets around the link.
I'm new to VisualForce and I haven't written any custom components yet. Is there a way to build a solution to this problem using custom components?
Jeri.
Create a Visualforce Component (I called mine hideDateLink.vfc) that contains then in the VFP, simple place the apex:inputfield between component tags as shown here
Thanks Gary Butler! Your solution worked perfectly for me. The other solutions were still leaving me with huge columns with empty space. I tried giving a thumbs up but it wouldn't let me.
.dateFormat{
visibility:hidden;
}
.anotherchildsectionitem fieldset {
display: inline-block;
}
</style>