I have а custom module that will show some reports. It will have two textfields, so when a user clicks one of the fields "starting date" and "end date" a calendar will popup and will able to select the dates. After selecting the dates, it will show the table with the results.
I've been using "Date" module with content type/fields, but I've never done in a custom module.
If these are the two fields:
<?php $content['starting_date'] = array( '#type' => 'textfield', '#title' => 'Starting date', ); $content['end_date'] = array( '#type' => 'textfield', '#title' => 'End date', ); ?>
How can I show the popup calendar when a user clicks on some of the textfields and show the results?
I'm using Drupal 7.
EDIT: I'm marking Clive's answer, but the date_popup works only on forms, not custom fields.