Incorporating the jqueryui autocomplete combobox on my jsp page, I am looking to assign the selected value of the combo-box to the HttpSession
.
My attempted solution was:
this._on(this.input, {
autocompleteselect: function (event, ui) {
// alert(ui.item.value);
var value = ui.item.value;
<% session.setAttribute("comboboxvalue", value); %>
ui.item.option.selected = true;
this._trigger("select", event, {
item: ui.item.option
});
}
The issue with this approach is that the code does not recognize the value
parameter.
How can I address this and establish a session attribute using javascript
?