Does anyone know how to grab the return value of the jQuery "selectable" interaction? Whenever I try to pick it up I receive "0" or false. I've tried setting a value for each selection, but get the same result.
I've trid to pick up the value as an ASP form and querystring object, but PHP input will do just as well.
JavaScript:
<script>
$(function() {
$("#selectable").selectable({
stop : function() {
var items = '';
var result = $("#select-result").empty();
$(".ui-selected", this).each(function() {
var index = $("#selectable li").index(this);
items += (index + 1);
});
alert('You have selected: ' + items);
$('input[name="bid"]').val(items);
}
});
$("#selectable li").addClass("ui-state-default");
});
</script>
HTML:
<ol id="selectable" name="podstatus">
<li class="ui-state-default" value="1">1</li>
<li class="ui-state-default" value="2">2</li>
<li class="ui-state-default" value="3">3</li>
<li class="ui-state-default">4</li>
<li class="ui-state-default">5</li>
<li class="ui-state-default">6</li>
<li class="ui-state-default">7</li>
<li class="ui-state-default">8</li>
<li class="ui-state-default">9</li>
<li class="ui-state-default">10</li>
<li class="ui-state-default">11</li>
<li class="ui-state-default">12</li>
</ol>
I've trid to pick up the value as an ASP form and querystring object, but PHP input will do just as well.