Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery select tag \ checkboxes with fusion tables
    text
    copied!<p>before starting, just let my say that my background is primarily in graphic design, therefore my knowledge of coding is ... limited! So be gentle :D</p> <p>Here my situation: I'm building a phonegap app for android with google maps api \ fusion tables \ jquery mobile. I've a list of checkboxes that trigger various type of markers from fusion tables, I've passed the state of checkboxes via jquery. Here's the function that filters the elements from the fusion tables:</p> <pre><code>function toggleMarkers(layer2) { var fusione = TABLE ID ; var arr_numero = []; var idx = 0; if (document.getElementById('toggleID').checked) { arr_numero[idx] = 1; idx++; } lista_numero = arr_numero.join(','); if (lista_numero == "") { lista_numero = "'no_selection'"; } layer2.setQuery("SELECT Location FROM "+ fusione +" WHERE numero IN (" + lista_numero + ")"); } </code></pre> <p>... here's the checkbox:</p> <pre><code>&lt;input type="checkbox" id="MYID" onclick="toggleMarkers(layer2);" /&gt; </code></pre> <p>.. and the JQ that "enables" the checkbox:</p> <pre><code>$(document).ready( function(){ $("#toggleID").change(function() {toggleMarkers(layer2);}); }); </code></pre> <p>SO, ;) this solution works pretty well but I would like to switch to select and option tags so it uses the native list UI of the OS!</p> <p>Something like this:</p> <pre><code>&lt;select size="1" id="listazza" multiple="multiple"&gt; &lt;option onclick="toggleMarkers(layer2);" onselect="toggleMarkers(layer2);" value="2" id="toggleID"&gt;ID&lt;/option&gt; &lt;/select&gt; </code></pre> <p>What kind of code do I have to use in JQ to trigger the option tag value?</p> <p>Hope this is clear enough, thanks in advance.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload