field

Properly render a field

Drupal offers a few (sometimes complicated...) solutions to output a field. Lets take an example with a date field.
To display the full rendered field: field_view_field()

Form field conditionnal display

In this snippet the text field mycustom is only displayed if the value of the select field myoptions is custom