I tried using ctools auto-submit on a date popup field I have, but it doesn't appear to work.

How could I get this to work or add support for it?

Here is my code:

function jump_to_date_form($edit = null) {

			ctools_add_js('auto-submit');

  			$form['date_from'] = array(
    			'#title' => t('Go to'),
    			'#type' => 'date_popup',
    			'#date_format' => 'Y-d-m',
    			'#description' => t(''),
    			'#attributes' => array('class' => 'ctools-auto-submit'),

			);

			$form['submit'] = array(
  				'#type' => 'submit',
  				'#value' => t('Go'),
  				'#attributes' => array('class' => 'ctools-use-ajax ctools-auto-submit-click'),
			);

	return $form;

Basically I'm trying to implement a very basic "jump to date" button.

Comments

gthing’s picture

Status: Active » Needs review

I have added this code:

  // Bind to any datepicker widgets that will be auto submitted.
  $('input[type=text].ctools-auto-submit:not(.ctools-auto-submit-processed),.ctools-auto-submit-full-form input[type=text]:not(.ctools-auto-submit-processed),.hasDatepicker')
    .addClass('.ctools-auto-submit-processed')
    .change(function() {
      //$(this.form).find('.ctools-auto-submit-click').click();
      $(this.form).submit();
    });

What are the chances of getting it reviewed and added to the next 6.x release? Also, is there any reason to use click() over submit()?