I'm using Symfony2 Framework, and this is what I want to do:
I want to change the value of an input type, but I want the value to be what I just selected with the selectable.
In the example at jquery.com I have the selected fields, but I need to have it on a hidden field so I could send it to a controller as a form data.
I've read the example in the JQuery Documentation but I'm having troubles changing it.
$(function() {
$( "#selectable" ).selectable({
stop: function() {
var result = $( "#select-result" ).empty();
$( ".ui-selected", this ).each(function() {
var index = $( "#selectable li" ).index( this );
result.append( " #" + ( index + 1 ) );
});
}
});
});
and I have this hidden field
<input name="horario" type="hidden" value=" " />
I want to change the value of the input field, for example, something like:
You have selected
#1 #2 #3 #4 #5 #6 #7 #8 #9 #10 #16 #17 #18 #19 #20 #21 #22 #23.