1

It appears that the module label help is not compatible with Date fields. It allows you to enter text, but it does not display.

I found out that in the div with class description should be above div id edit-field-geboortedatum-und-0-value instead of below

How to achieve this? Should I change a weight key in something?

enter image description here

1

You can use $form['#after_build'] to modify a form. Put below element at the end of your hook_form function.

$form['#after_build'][] = 'FORM_NAME_after_build'; //Calls function

After build function to change the position of DIV

function FORM_NAME_after_build($form, $form_state) {
  drupal_add_js('jQuery(document).ready(function ($) {
    $("#edit-field-geboortedatum-und-0-value").insertAfter($(".description"));
  });', array('type' => 'inline', 'scope' => 'footer', 'weight' => 5));

  return $form;
}
  • works perfectly! – Justme Dec 11 '16 at 13:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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