diff --git a/src/jquery.tagger.js b/src/jquery.tagger.js index 2d367f9..a48f6b9 100644 --- a/src/jquery.tagger.js +++ b/src/jquery.tagger.js @@ -100,7 +100,7 @@ * @property {boolean} clearFilterOnBlur - Clear the filter text if any was left when the field loses focus (stops users thinking typed in text will be sent) * @property {boolean} freeTextInput - Enable users to create options not defined in availableTags by hitting enter after typing text * @property {string} freeTextPrefix - Optional string to prefix all free text option values with (helpful to differentiate server-side) - * @property {string} freeTextMessage - String to show in the suggestions list after the free text to hint that it can be added e.g. (New Postcode) + * @property {string} freeTextMessage - HTML string to show in the suggestions list containing the free text to hint that it can be added e.g. Add <em>%VALUE%</em> to list * @property {string} freeTextSuggest - Allow free text values in the select to show up in the suggestions list */ options: { @@ -136,7 +136,7 @@ , clearFilterOnBlur : false , freeTextInput : false , freeTextPrefix : null - , freeTextMessage : '' + , freeTextMessage : null , freeTextSuggest : false }, @@ -882,11 +882,19 @@ // When free text mode is on let users click this item to add whatever they typed to the selected tags if (this.options.freeTextInput && this._getVisibleInput().val().length > 0) { + var message; + if (this.options.freeTextMessage) { + message = this.options.freeTextMessage.replace(/%VALUE%/g, $("