Open vikas-github opened 11 years ago
Bump. I am having this same problem. I am not the best at JavaScript nor did I spend much time looking at jquery.autosuggest.js but I cannot find anywhere in the code that there is a function for removal of an item (one that would essentially fix this problem). There are definitely add_selected_item and moveSelection but no remove_item or something similar. Perhaps we will need to code this ourselves?
I found this code but it is obviously not working or this issue would not have been experienced by multiple users.
var close = $('×').click(function(){ if(!is_new_value){ values_input.val(values_input.val().replace(","+data[opts.selectedValuesProp]+",",",")); } else { $('input[value='+data[opts.selectedValuesProp]+']').remove(); } opts.selectionRemoved.call(this, item); input_focus = true; input.focus(); return false; });
Perhaps the selection is not being made properly by using data[opts.selectedValuesProp]?
If you want, I'd put some time into a reworked fork at https://github.com/hlsolutions/jquery-autosuggest
I was thinking there was a newer fork. Is the issue solved in this one?
Is there a way to restore the old functionality where it would name the parameter sets something like "set_projects" or "set_customers"? I have specifically named sets in my code that I'm trying to grab and this randomly generated "as_values_xx" thing won't work. I'm sure there has been an issue generated on this that you may know about? I'll check out the issues section after this, just curious if you already know of one.
when I select element with value "1", value attribute of input.as-values is populated with "1," when I remove this element and select another element with value "2", this value is getting appended to previous value and value of input.as-values becomes "1,2," where it should delete the value "1,", but it still has it.
how to solve this problem? i want the id of the selected element at the server side. pls help