I was going to post a question on how coul I achieve that but insted here's what I did.
Extremely simple but makes it easier to choose what character should separate the sugested items... (I needed it to be ";")
Hope it's of use...
ADDED:
splitter = ','; //define the custom splitter char
CHANGED:
function getUserInputToMatch(s) {
...
fields = s.split(splitter);
...
}
function getUserInputBase() {
...
if ((lastComma = s.lastIndexOf(splitter)) != -1) {
a = a.replace(/^(.*\splitter[ \r\n\t\f\s]*).*$/i,'$1');
...
}
function runMatchingLogic(userInput, standalone) {
...
if (siw) {
siw.lastUserInput = userInput;
siw.revisedCollection = tempCollection.join(splitter).split(splitter);
collectionIndex[userInput] = tempCollection.join(splitter).split(splitter);
}
if (standalone || siw.buildIndex) {
collectionIndex[uifc] = tempCollection.join(splitter).split(splitter);
if (siw) siw.buildIndex = false;
}
}//runMatchingLogic
I was going to post a question on how coul I achieve that but insted here's what I did.
Extremely simple but makes it easier to choose what character should separate the sugested items... (I needed it to be ";")
Hope it's of use...
ADDED:
splitter = ','; //define the custom splitter char
CHANGED:
function getUserInputToMatch(s) {
...
fields = s.split(splitter);
...
}
function getUserInputBase() {
...
if ((lastComma = s.lastIndexOf(splitter)) != -1) {
a = a.replace(/^(.*\splitter[ \r\n\t\f\s]*).*$/i,'$1');
...
}
function runMatchingLogic(userInput, standalone) {
...
if (siw) {
siw.lastUserInput = userInput;
siw.revisedCollection = tempCollection.join(splitter).split(splitter);
collectionIndex[userInput] = tempCollection.join(splitter).split(splitter);
}
if (standalone || siw.buildIndex) {
collectionIndex[uifc] = tempCollection.join(splitter).split(splitter);
if (siw) siw.buildIndex = false;
}
}//runMatchingLogic
function activateCurrentSmartInputMatch() {
...
theString = (baseValue ? baseValue : "") + addedValue + splitter + " ";
...
}
sorry.. this has a bug on the regular expressions.. I'm trying to fix it...
Could you use:
var RegularExpression = new RegExp("^(.*"+splitter+"[ \r\n\t\f\s]*).*$","i");
a = a.replace(RegularExpression,'$1');
Granted, I haven't tested it, but it seems like it would work...