How do you add help text to a form item? I would like to change the help text for an input field. My form ID is views-exposed-form-events-page-1. I have a text field that I want the helpful hint to appear below. The field ID is edit-field-event-date-value2, I think, based on the HTML.

&lt;div id="edit-field-event-date-value2-wrapper" class="views-exposed-widget views-widget-filter-field_event_date_value2"&gt;
&lt;label for="edit-field-event-date-value2"&gt;
From &lt;/label&gt;
&lt;div class="views-widget"&gt;
&lt;div id="edit-field-event-date-value2-value-wrapper"&gt;
&lt;div id="edit-field-event-date-value2-value-inside-wrapper"&gt;
&lt;div  class="container-inline-date"&gt;&lt;div class="form-item form-item-field-event-date-value2-value form-type-date-popup form-group"&gt;
&lt;div id="edit-field-event-date-value2-value"  class="date-padding"&gt;&lt;div class="form-item form-item-field-event-date-value2-value-date form-type-textfield form-group"&gt;
&lt;input class="form-control form-text" type="text" id="edit-field-event-date-value2-value-datepicker-popup-0" name="field_event_date_value2[value][date]" value="18/12/2019" size="20" maxlength="30" /&gt; 
&lt;label class="control-label element-invisible" for="edit-field-event-date-value2-value-datepicker-popup-0"&gt;Date&lt;/label&gt;
&lt;div class="help-block"&gt; E.g., 18/12/2019&lt;/div&gt;


I thought that this would work, but I'm not seeing any help text appearing under the form field.

function mytheme_form_views_exposed_form_events_page_1_alter(&amp;$form, &amp;$form_state, $form_id) {
  $form['edit-field-event-date-value2']['#attributes']['description'] = 'DD/MM/YYYY';
}


What am I doing wrong?
The description doesn't live under #attributes, but under the element directly.

So you must do something like this to get it to work:

$form['field_event_date_value2']['#description'] = 'DD/MM/YYYY';


The HTML class is not the fieldname, but rather something like field_event_date_value2 in your case.

If that is not the correct fieldname, you can try to print_r(array_keys($form)) to see if you can see what the correct name is.