diff --git a/chosen/chosen.jquery.js b/chosen/chosen.jquery.js index e610561..d373f6c 100644 --- a/chosen/chosen.jquery.js +++ b/chosen/chosen.jquery.js @@ -44,7 +44,7 @@ }; Chosen.prototype.set_up_html = function() { var container_div, dd_top, dd_width, sf_width; - this.container_id = this.form_field.id.length ? this.form_field.id.replace('.', '_') : this.generate_field_id(); + this.container_id = this.form_field.id.length ? this.form_field.id.replace(/(:|\.)/g, '_') : this.generate_field_id(); this.container_id += "_chzn"; this.f_width = this.form_field_jq.width(); this.default_text = this.form_field_jq.data('placeholder') ? this.form_field_jq.data('placeholder') : this.default_text_default; diff --git a/chosen/chosen.proto.js b/chosen/chosen.proto.js index b602dc3..45d23ea 100644 --- a/chosen/chosen.proto.js +++ b/chosen/chosen.proto.js @@ -36,7 +36,7 @@ }; Chosen.prototype.set_up_html = function() { var base_template, container_props, dd_top, dd_width, sf_width; - this.container_id = this.form_field.identify().replace('.', '_') + "_chzn"; + this.container_id = this.form_field.identify().replace(/(:|\.)/g, '_') + "_chzn"; this.f_width = this.form_field.getStyle("width") ? parseInt(this.form_field.getStyle("width"), 10) : this.form_field.getWidth(); container_props = { 'id': this.container_id, diff --git a/coffee/chosen.jquery.coffee b/coffee/chosen.jquery.coffee index 1bbcecc..e6d968b 100644 --- a/coffee/chosen.jquery.coffee +++ b/coffee/chosen.jquery.coffee @@ -44,7 +44,7 @@ class Chosen @choices = 0 set_up_html: -> - @container_id = if @form_field.id.length then @form_field.id.replace('.', '_') else this.generate_field_id() + @container_id = if @form_field.id.length then @form_field.id.replace(/(:|\.)/g, '_') else this.generate_field_id() @container_id += "_chzn" @f_width = @form_field_jq.width() diff --git a/coffee/chosen.proto.coffee b/coffee/chosen.proto.coffee index e639190..b0d9e1a 100644 --- a/coffee/chosen.proto.coffee +++ b/coffee/chosen.proto.coffee @@ -42,7 +42,7 @@ class Chosen set_up_html: -> - @container_id = @form_field.identify().replace('.', '_') + "_chzn" + @container_id = @form_field.identify().replace(/(:|\.)/g, '_') + "_chzn" @f_width = if @form_field.getStyle("width") then parseInt @form_field.getStyle("width"), 10 else @form_field.getWidth()