Hi there,
I made a script that posts the selected values to process.php. I got it working for the combobox (see snippet 1) and in the process.php file I can access the variable like this:
$example = ($_GET['example']) ?$_GET['example'] : $_POST['example'];
- <div class="element">
<label>Example 1</label>
<select id="combobox" name="example">
<option value="Option 1">Option 1</option>
<option value="Option 2">Option 2</option>
</select>
</div>
However, for the selectable I can't seem to figure out how I can access the values. Here's the relevant code:
- <script>
$(function() {
$( "#selectable" ).selectable({
stop: function() {
var result = $( "#select-result" ).empty();
$( ".ui-selected", this ).each(function() {
var value = $( this ).text();
result.append( " #" + ( value ) );
});
}
});
});
</script>
- <div class="element">
<label>Example</label>
<br>
<ol id="selectable">
<li class="ui-state-default">Option 1</li>
<li class="ui-state-default">Option 2</li>
<li class="ui-state-default">Option 3</li>
</ol>
<p id="feedback">
<span>You've selected:</span> <span id="select-result">none</span>.
</p>
</div>
Any suggestions how I can get the values? Thanks in advance!