From 3349566701615821b33b2132fca5d53451e718da Mon Sep 17 00:00:00 2001 From: Patrick Cook Date: Mon, 17 Sep 2012 12:48:14 -0700 Subject: [PATCH 1/2] Escape HTML characters in comboxbox options --- jquery/js/jquery.combobox.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jquery/js/jquery.combobox.js b/jquery/js/jquery.combobox.js index 8aaec45..93b6892 100644 --- a/jquery/js/jquery.combobox.js +++ b/jquery/js/jquery.combobox.js @@ -175,7 +175,9 @@ this.optionCount = selectOptions.length; var ulElement = jQuery('').appendTo(this.selectorElement); for (i = 0; i < selectOptions.length; i++) { - ulElement.append('
  • '+selectOptions[i]+'
  • '); + ulElement.append(jQuery('
  • ', { + text: selectOptions[i] + })); } var thisSelector = this; this.selectorElement.find('li').click(function (e) { From 1b2433c3eb334146d21702f221d17b4f9fa3d819 Mon Sep 17 00:00:00 2001 From: Patrick Cook Date: Mon, 17 Sep 2012 14:51:10 -0700 Subject: [PATCH 2/2] Modified to read text of selection option instead of HTML --- jquery/js/jquery.combobox.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jquery/js/jquery.combobox.js b/jquery/js/jquery.combobox.js index 93b6892..1599aff 100644 --- a/jquery/js/jquery.combobox.js +++ b/jquery/js/jquery.combobox.js @@ -182,7 +182,7 @@ var thisSelector = this; this.selectorElement.find('li').click(function (e) { thisSelector.hide(); - thisSelector.combobox.setValue(this.innerHTML); + thisSelector.combobox.setValue(jQuery(this).text()); thisSelector.combobox.focus(); }); this.selectorElement.mouseover(function (e) { @@ -243,7 +243,7 @@ getSelectedValue : function () { if(this.selectedIndex !== -1){ - return this.selectorElement.find('li').get(this.selectedIndex).innerHTML; + return jQuery(this.selectorElement.find('li').get(this.selectedIndex)).text(); } else { return this.combobox.textInputElement.val(); }