I'm using Jquery Autocomplete based on: http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/. I am able to select a value from the textbox and add it to a list as in the example. Is it possible to add the selected value to a hidden field? For example <input type='hidden' value='value 1,value 2, value 3' name="SelectedValue" id="SelectedValue"/>
views:
54answers:
2
A:
$('input#suggest').result(function(event, data, formatted) {
$("#SelectedValue").val( $("#SelectedValue").val() + "," data );
});
Look over autocomplete documentation for details
ShiVik
2010-08-17 09:27:50
A:
To add more than one value to a hidden field:
var hdnValue = $('hdnFieldName').val();
$('hdnFieldName').val(hdnValue +','+selectedValue);
Have a look at string.join as well.
cofiem
2010-08-17 09:28:06