Commit de05f7e7 authored by davidcalhoun's avatar davidcalhoun

faq: add example of getting values dynamically

parent 8b201843
......@@ -4101,7 +4101,18 @@ $(document).ready(function() {
<dd>
This issue is addressed in <a href="https://github.com/davidstutz/bootstrap-multiselect/issues/322">#322</a>
</dd>
<dt>Using jQuery, how to get the selected options dynamically?</dt>
<dd>
<pre class="linenums prettyprint">
// get all option elements
$('#example option:selected');
// get all option element values
$('#example option:selected').map(function(a, item){return item.value;});
</pre>
</dd>
<dt>How to get the selected options using PHP?</dt>
<dd>
This issue is addressed here: <a href="https://github.com/davidstutz/bootstrap-multiselect/issues/323">https://github.com/davidstutz/bootstrap-multiselect/issues/323</a>. Mainly there are two ways, either add a name to the <code>select</code>:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment