Download & Extend

Disabling input fields for jscalendar only

Project:Views Date Range Filter
Version:5.x-1.7
Component:User interface
Category:support request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

With reference to my previous question, http://drupal.org/node/232068, is there some way to use some CSS or some other code to disable the input box so that only jscalendar can enter the dates there.

That would be a quick and foolproof solution to the problem.

Comments

#1

I would solution as follows: in the form_alter

if ($form_id == 'views_filters')
{
if($form['#view_name'] == 'nameyourview')
{
$form['filter1']['date1']['#attributes'] = Array ( 'title' => 'YYYY-MM-DD, today, yesterday, today-7, today-2M, today-1Y',
'class' => jscalendar,
'readonly' => 'readonly' );
$form['filter1']['date2']['#attributes'] = Array ( 'title' => 'YYYY-MM-DD, today, yesterday, today-7, today-2M, today-1Y',
'class' => jscalendar,
'readonly' => 'readonly' );
}
}

Bye

nobody click here