I have a D7 form with a date element on it. I want it not to display 'day', 'month', and 'year' elements. I looked at '#display_title' => FALSE
but that doesn't work.
Can I disable the display in the form definition, or must I do this elsewhere?
I have a D7 form with a date element on it. I want it not to display 'day', 'month', and 'year' elements. I looked at '#display_title' => FALSE
but that doesn't work.
Can I disable the display in the form definition, or must I do this elsewhere?
I think the property you're looking for is #title_display
, not #display_title
. Also you wouldn't set it to FALSE
but one of these:
In your case you'd want to set it to invisible
:
$form['element']['#title_display'] = 'invisible';
That will render the label, so your form remains accessible, but hide it from display.