loopj/jquery-tokeninput — Issue #226: changing input query format - first letter of each word capital.
Author: anujkk
Created: 2011-12-03 07:49:17+00:00
State: open

Hi,

I'm using this plugin to add "artists" to some music related pages. As new entries may or may not already exist in database I am just returning the entered search query along with other search results in json response from my php.

For example, if I am searching "Michael Jackson" and if it doesn't exist in db records, "michael jackson" is added in the response I'm sending from server. This is working fine but the problem is that the search query is getting converted in all lower case. I noticed in code that it is due to toLowerCase() calls.

Is there any way so that instead of making it all lower case it makes first letter of each word capital? e.g.,

michael jackson becomes Michael Jackson
michael.jackson becomes Michael Jackson

Also is there any way to restrict input to alphanumeric(a-z,A-z,0-9) ,dot(.), single quote('), and hyphen(-) characters?