Skip to content

Commit

Permalink
add a param for placeholder text on the automatically created input e…
Browse files Browse the repository at this point in the history
…lement
  • Loading branch information
benoberkfell committed Nov 17, 2011
1 parent 396745e commit a877af5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ Optionally set a *tabindex* attribute on the `input` that gets created for tag-i

Defaults to *null*

### placeholderText (String)
Optionally set a *placeholder* attribute on the `input` that gets created for tag-it user input.

Defaults to *null*


## Events

Expand Down
4 changes: 4 additions & 0 deletions js/tag-it.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
tagSource : null,
removeConfirmation: false,
caseSensitive : true,
placeholderText : null,

// When enabled, quotes are not neccesary
// for inputting multi-word tags.
Expand Down Expand Up @@ -100,6 +101,9 @@
if (this.options.tabIndex) {
this._tagInput.attr('tabindex', this.options.tabIndex);
}
if (this.options.placeholderText) {
this._tagInput.attr('placeholder', this.options.placeholderText);
}

this.options.tagSource = this.options.tagSource || function(search, showChoices) {
var filter = search.term.toLowerCase();
Expand Down

0 comments on commit a877af5

Please sign in to comment.