0

I installed the Date Picker module, which works fine. This is what appears when I add the datepicker element to the form.

screenshot

This is the code I use to add the datepicker element.

$form['date'] = array(
  '#title' => t('Select your birthdate'),
  '#type' => 'datepicker',
  '#date_format' => 'd/m/Y',
  '#date_year_range' => '-100:+0',
  '#default_value' => date("Y-m-d H:i:s", time()),
);

I want to display a text field; when it has the focus, the calendar should be shown.

How should I change the code to make it possible?

0

1 Answer 1

0

Have you tried using DatePicker inline module?

From module page:

This module permits inline rendering of date's popup widget. That is, it display the datepicker embedded in the page instead of in an overlay.

It integrates with field API, form API and views exposed filters (via date_views).

Your Answer

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