Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

value attribute is not populated with real value. #31

Open
vikas-github opened this issue Jun 27, 2013 · 7 comments
Open

value attribute is not populated with real value. #31

vikas-github opened this issue Jun 27, 2013 · 7 comments

Comments

@vikas-github
Copy link

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

@Pharserror
Copy link

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?

@Pharserror
Copy link

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]?

@knalli
Copy link
Contributor

knalli commented Jul 1, 2013

If you want, I'd put some time into a reworked fork at https://github.com/hlsolutions/jquery-autosuggest

@Pharserror
Copy link

I was thinking there was a newer fork. Is the issue solved in this one?

@knalli
Copy link
Contributor

knalli commented Jul 1, 2013

@Pharserror
Copy link

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.

@Pharserror
Copy link

Found it. hlsolutions@71a8961

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants