I checked the plugin, I think it never worked with selected value of the select, but it use the current value only a run time.
This is because the setInputValues function set the selected property if is it undefined in the data object.
I have fixed the code by setting the property only if the data object is not undefined.
See:
// import values into <input> commands
$.contextMenu.setInputValues = function(opt, data) {
if (data === undefined) {
data = {};
}
$.each(opt.inputs, function(key, item) {
switch (item.type) {
case 'text':
case 'textarea':
item.value = data[key] || "";
break;
case 'checkbox':
item.selected = data[key] ? true : false;
break;
case 'radio':
item.selected = (data[item.radio] || "") == item.value ? true : false;
break;
case 'select':
if (data[key]!=undefined ){
item.selected = data[key] || "";
}
break;
}
});
};
Working fiddle: http://jsfiddle.net/vYnv3/1/
Here is a pastebin of the fixed code: http://pastebin.com/Mg3j7ifB
If works weel I'll fork the fix.
EDIT
Added support for radio and checkbox too:
// import values into <input> commands
$.contextMenu.setInputValues = function(opt, data) {
if (data === undefined) {
data = {};
}
$.each(opt.inputs, function(key, item) {
switch (item.type) {
case 'text':
case 'textarea':
item.value = data[key] || "";
break;
case 'checkbox':
if (data[key]!=undefined ){
item.selected = data[key] ? true : false;
}
break;
case 'radio':
if (data[item.radio]!=undefined ){
item.selected = (data[item.radio] || "") == item.value ? true : false;
}
break;
case 'select':
if (data[key]!=undefined ){
item.selected = data[key] || "";
}
break;
}
});
};
New pastebin: http://pastebin.com/c8XFVMiD
Working fiddle: http://jsfiddle.net/vYnv3/2/