saroj
saroj

Reputation: 653

date picker not appearing

I am trying to display a date picker in 2nd green color but date-picker is n't appearing, but in 1st green color it is coming fine. What should i modify? In fiddle first date is coming fine but when i am clicking green colour of 2nd text box and nothing appears. What type of modification does it require?

Here is the fiddle

http://jsbin.com/unosar/8/edit#javascript,html,live

Any solution please

Upvotes: 0

Views: 185

Answers (2)

Stefano
Stefano

Reputation: 18530

Your HTML is invalid: you cannot use twice an id, the id attribute must be unique.

It's enough to make it into a class and all will work (see http://jsbin.com/unosar/19/edit#javascript,html,live)

Also, toggle_class can be a simple string, not only an array: http://www.monkeyphysics.com/mootools/script/2/datepicker#examples

By the way, you should use the official improved mootools datepicker instead.

Upvotes: 1

Sudhir Bastakoti
Sudhir Bastakoti

Reputation: 100175

You are using same ids for 2 div, either change that to class or use unique ids, like

#invokeDP {
 width: 20px;
 height: 20px;
 background: green;
 display: inline-block;    
}
  #invokeDP2 {
 width: 20px;
 height: 20px;
 background: green;
 display: inline-block;    
}

var dp = new DatePicker('.picker', {
  pickerClass: 'datepicker ',
  allowEmpty: true,
    toggleElements: ['invokeDP', 'invokeDP2'] //2 divs with 2 unique ids
});

Upvotes: 6

Related Questions