1

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?

1
  • I did this in css: div.container-inline-date { display: none; }
    – LLub
    Commented Apr 2, 2012 at 18:58

1 Answer 1

1

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:

  • before
  • after
  • invisible
  • attribute

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.