CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Date selection widget not showing
Pages: [1]

Author Topic: Date selection widget not showing  (Read 615 times)

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Date selection widget not showing
May 13, 2012, 10:23:07 pm
I am using the hook "civicrm_searchTasks" to add a date field for the user. I am adding the date field as follows:

function buildQuickForm( ){
  $this->addDate('membership_startdate', ts('Start Date'), false, array( 'formatType' => 'custom' ), true );

}


Then in my tpl file:

  <td>{$form.membership_startdate.html}</td>



The field shows up as a plain input field. The usual date selection widget is not shown.  The same  $this->addDate(...) syntax works fine in my custom search, but it does not work inside this custom action.

Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Date selection widget not showing
May 13, 2012, 11:24:02 pm
I found the solution. I had to change my tpl file to use:

{include file="CRM/common/jcalendar.tpl" elementName='membership_startdate'}
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Date selection widget not showing

This forum was archived on 2017-11-26.