jtsage / jtsage-datebox

A multi-mode date and time picker for Bootstrap (3&4), jQueryMobile, Foundation, Bulma, FomanticUI, and UIKit (or others)
http://datebox.jtsage.dev/
Other
474 stars 166 forks source link

period in id attribute of input element that is tied to a label via "for" causes an jquery to blow up #234

Closed Leonidaz closed 11 years ago

Leonidaz commented 12 years ago

period in id attribute of input element that is tied to a label via "for" causes an jquery to blow up:

if there is a

<label for="my.control.with.dots"><input id="my.control.with.dots" type="text" data-role="datebox" />

jQuery errors out.

Need to make sure label for is inside single or double quotes in the code.

Leonidaz commented 12 years ago

github will not let me fork the project to create a pull request, so here's the fix while they sort it out: inside function: _grabLabel (current lines as of nov.30.2012) 1137, 1138

if ( w.d.wrap.parent().find('label[for=\''+w.d.input.attr('id')+'\']').text() !== '' ) {
    return w.d.wrap.parent().find('label[for=\''+w.d.input.attr('id')+'\']').text();
}
jtsage commented 11 years ago

oh, looks like this is something else - whoops. reopening to take a look.

Leonidaz commented 11 years ago

yes, they both got pulled into the same pull request. this is just a quick fix.