Datepicker is not working. This code working with Drupal 6, but not with Drupal 7.
drupal_add_js(drupal_get_path('module', 'PROPERTY') .'/jquery/jquery-1.4.1.js', 'module');
drupal_add_js(drupal_get_path('module', 'PROPERTY') .'/jquery/jquery.min.js', 'module');
drupal_add_js(drupal_get_path('module', 'PROPERTY') .'/jquery/jquery-ui.min.js', 'module');
drupal_add_js(drupal_get_path('module', 'PROPERTY') .'/jquery/datepicker.js', 'module');
drupal_add_js(drupal_get_path('module', 'PROPERTY') .'/jquery/ztfb_datepicker.js', 'module');
drupal_add_css(drupal_get_path('module', 'PROPERTY') .'/jquery/ui.all.css', 'module');
drupal_add_js(drupal_get_path('module', 'PROPERTY') .'/jquery/scrollJump.js', 'module');
$(document).ready(function() {
$("#startdate").datepicker({
dateFormat:'dd-mm-yy',
autosize:false,
changeYear:true,
changeMonth:true
});
});
I include the file in PROPERTY_Form.admin.inc file.
require_once("D://wamp/www/propertysite/cron/includes/jquerydatepicker.php");
function PROPERTY_Form() {
global $user;
$form = array();
$form['PROPERTY_Form']['startSyncFrom'] = array(
'#type' => 'textfield',
'#prefix'=>'<tr><td>',
'#suffix'=>'</td></tr>',
'#id'=>'startdate',
'#default_value'=>date('d-m-Y'),
'#description' => '(You can select any past date to ensure even your old Data gets synced)',
'#attributes'=>array('tabindex'=>9,'style'=>'width:70px;'),
);
return $form;
}