]> source.dussan.org Git - jquery-ui.git/commitdiff
Fixed 3108 Allow ids with square brackets
authorKeith Wood <kbwood.au@gmail.com>
Wed, 23 Jul 2008 10:29:15 +0000 (10:29 +0000)
committerKeith Wood <kbwood.au@gmail.com>
Wed, 23 Jul 2008 10:29:15 +0000 (10:29 +0000)
Fixed 3113 Allow ids with colon or period

ui/ui.datepicker.js

index a07a4df5555387ee628bfafd7a5e4992faa92baf..b0564cb942ad34baf83ee1cc4991dbfe7ac9d1ea 100644 (file)
@@ -177,7 +177,8 @@ $.extend(Datepicker.prototype, {
 
        /* Create a new instance object. */
        _newInst: function(target, inline) {
-               return {id: target[0].id, input: target, // associated target
+               var id = target[0].id.replace(/([:\[\]\.])/g, '\\\\$1'); // escape jQuery meta chars
+               return {id: id, input: target, // associated target
                        selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
                        drawMonth: 0, drawYear: 0, // month being drawn
                        inline: inline, // is datepicker inline or not