user4910881
user4910881

Reputation:

Jquery DatePicker not working all dependencies included

I'm trying to setup Jquery UI datepicker but it's not working. I've made a demo of my setup here: https://jsfiddle.net/950g0oku/

The input field is

<input id="id_dates-0-starts" class="datetime field_required hasDatepicker" type="text" name="dates-0-starts">

and the javascript

$(".datetime").datepicker();

Upvotes: 1

Views: 100

Answers (4)

Glitson George
Glitson George

Reputation: 53

Dont use hasDatepicker as a class name. This name is used by the jquery datepicker for rendering. please refer to this jsfiddle

Upvotes: 0

DFayet
DFayet

Reputation: 881

You need to remove the class hasDatepicker from your field.

Take a look at this updated version of your fiddle (yours updated).

jQuery uses this class and it seems that if the class hasDatepicker is used the calendar's function does not show anything.

Hope it may helps

Upvotes: 1

EdenSource
EdenSource

Reputation: 3387

Why are you using the hasDatepicker class ? Remove it from your input and it works. Please see the Fiddle.

Fact is, jQuery-ui also use this classname, so when you use it, it seems there is a conflict.

Upvotes: 1

vijayP
vijayP

Reputation: 11512

I just removed the class hasDatepicker and now its working:

https://jsfiddle.net/950g0oku/3/

Upvotes: 1

Related Questions