I\'ve been using jQuery UI with Bootstrap and I seem to run into a problem that I haven\'t had before. I\'m not sure what has changed; I\'ve tried setting back different ver
I've ran into this problem too, and i was 100% sure i did not use duplicate id. After some debugging i found out a reason - i was using DataTables mod, which duplicates contents of tfoot, thus creating exact copy of datepicker elements. And i had this datepicker inputs in tfoot row.
Fixed that issue with:
table.find("TFOOT").find("TR:first").remove();
Which is called AFTER table.DataTable(....)
This removed original, zero height row with all contents;
I've found the solution. After a long time of debugging I figured out that there was a <div>
that had the exact same ID
, lying higher than the input field. Therefore the script took the first instance that contained the ID
and picked the DIV
instead of the input
field.
I removed/renamed the DIV
and it worked fine again.
I was having this error also. I found that elsewhere on the form I had some label 'for' attributes that did not match ids on the form inputs - seems like this might confuse datepicker too. Once I fixed those up, everything worked fine and the error went away. Take Andreas' advice (+1 for that!) and validate your forms - Chris Pederick's Web Developer Toolbar gives you an easy way to validate as you go.
The above jQuery datepicker error is generally caused by having a duplicate controls with the same ID, no matter whether you use id or another selector like css class or field name to instantiate it.
I solved this with create new ID for HTML DOM object. There is duplicated Id. Try to add new ID for HTML DOM object.
In my case I was triggering the datepicker from a div against a hidden input field and getPos(a) was causing an undefined message on the variable "a". I experimented with moving the hidden input field outside of a div and that did the trick. Note that the input field was findable by jQuery no matter where it was, so that was not the problem - it was with positioning. Hope this helps someone else.