Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Regarding your screenshot, what you want to use are <code>checkbox</code>, not <code>radio</code> inputs.</p> <p>Radio inputs are a group of inputs related to each others, they have a common name, they share the same meaning.</p> <p>Common examples:</p> <ol> <li>"Select your method of payment": VISA, Mastercard, etc..</li> <li>"Select your gender": Male or Female</li> </ol> <p>Corresponding <code>HTML</code>:</p> <pre><code>&lt;input type="radio" name="payment_type" value="visa" /&gt; &lt;input type="radio" name="payment_type" value="mastercard" /&gt; ... </code></pre> <p>As you can note, with <code>radio</code> inputs, only one value is possible (you cannot pay with VISA and Mastercard, you have to choose).</p> <p>So when you select one, all the other options (of the same group) are unchecked.</p> <p>This is not the case in your screenshot: you have various lines "checked" ("SI") and various others "unchecked" ("NO").</p> <p>So what you want to use are <code>checkbox</code>, not <code>radio</code>, like that:</p> <pre><code>&lt;div class="make-switch"&gt; 3M ITALIA SPA &lt;input type="checkbox" name="00839770708" value="yes" /&gt; &lt;/div&gt; &lt;div class="make-switch"&gt; BABINI SPA &lt;input type="checkbox" name="00481821213" value="yes" checked="checked" /&gt; &lt;/div&gt; &lt;div class="make-switch"&gt; ARTIGLASS ARTICOLI.. &lt;input type="checkbox" name="23467894567" value="yes" checked="checked" /&gt; &lt;/div&gt; ... </code></pre> <p><em>Note</em>: Of course, you have to use your <a href="http://www.bootstrap-switch.org/" rel="nofollow">bootstrap switch</a>es as <code>checkbox</code> (default behavior) and not anymore as <a href="http://www.bootstrap-switch.org/#radio-javascript" rel="nofollow"><code>radio</code></a>..</p> <p>And you don't need to update the value to <code>yes</code> or <code>no</code>.. After all <code>yes</code> correspond to "checked" and <code>no</code> to..</p> <p>You already know that information, that state, thanks to the <code>checkbox HMTL input</code> (jQuery):</p> <pre><code>$('input[name=00839770708]').attr("checked") // --&gt; returns false $('input[name=00481821213]').attr("checked") // --&gt; returns true ... </code></pre> <hr> <p>Now, to respond your original question:</p> <p><em>"What i want to know is how i can pass a parameter to name selector?"</em></p> <p>You can build the selector (a <code>string</code>..) dynamically:</p> <pre><code>var arr = ['00839770708', '00481821213', '23467894567']; for (var i=0; i&lt;arr.length; i++) { console.log( $('input[name='+arr[i]+']').attr('checked') ); } </code></pre> <p>This will output in the console:</p> <pre><code>&gt; false &gt; true &gt; true </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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