Hi, i am newbie here, i haved a little problem with "onselect", i needed control of adding new item from these function, i fixed these problem, by editing addItem, i hope in new versions it will be included
function addItem(title, value, preadded, locked, focusme) {
if (!maxItems()) {
return false;
}
var liclass = "bit-box" + (locked ? " locked": "");
var id = randomId();
var txt = document.createTextNode(xssDisplay(title));
var aclose = $('<a class="closebutton" href="#"></a>');
var li = $('<li class="'+liclass+'" rel="'+value+'" id="pt_'+id+'"></li>').prepend(txt).append(aclose);
var _item = $('<option value="'+xssDisplay(value, 1)+'" id="opt_'+id+'" class="selected" selected="selected">'+xssDisplay(title)+'</option>');
if (options.onselect) {
if(funCall(options.onselect, _item) === false) return false;
}
holder.append(li);
aclose.click( function() {
removeItem($(this).parent("li"));
return false;
});
if (!preadded) {
$("#" + elemid + "_annoninput").remove();
addInput(focusme);
element.append(_item);
element.change();
}
holder.children("li.bit-box.deleted").removeClass("deleted");
clear_feed(1);
return id;
}
Hi, i am newbie here, i haved a little problem with "onselect", i needed control of adding new item from these function, i fixed these problem, by editing addItem, i hope in new versions it will be included
usage: