Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Yes, it certainly is but it will take some javascript code. </p> <p>Here is an example based on the code snippet you pasted:</p> <p><a href="http://jsfiddle.net/EmNSe/" rel="nofollow">http://jsfiddle.net/EmNSe/</a></p> <pre><code>&lt;form method="post" name="myForm"&gt; &lt;input type="checkbox" name="fruit[]" value="apple" id="apple" onclick="selectionListener();" /&gt; &lt;label for="apple"&gt;Apple&lt;/label&gt; &lt;br /&gt; &lt;input type="checkbox" name="fruit[]" value="pinapple" id="pinapple" onclick="selectionListener();" /&gt; &lt;label for="pinapple"&gt;Pinapple&lt;/label&gt; &lt;br /&gt; &lt;input type="checkbox" name="fruit[]" value="grapefruit" id="grapefruit" onclick="selectionListener();" /&gt; &lt;label for="grapefruit"&gt;Grapefruit&lt;/label&gt; &lt;br /&gt; &lt;br /&gt; &lt;label for="SelectionMade"&gt;Selection Made:&lt;/label&gt; &lt;textarea rows="4" cols="50" name-"SelectionMade" id="SelectionMade"&gt; &lt;/textarea&gt; &lt;br /&gt; &lt;br /&gt; &lt;input type="submit" name="go" /&gt; &lt;/form&gt; </code></pre> <p>and the javascript:</p> <pre><code>function selectionListener() { checkedStr = ''; if (document.getElementById('grapefruit').checked) { checkedStr = checkedStr + "grapefruit is checked!\n"; } if (document.getElementById('pinapple').checked) { checkedStr = checkedStr + "pinapple is checked!\n"; } if (document.getElementById('apple').checked) { checkedStr = checkedStr + "apple is checked!\n"; } document.getElementById('SelectionMade').value = checkedStr; } </code></pre>
 

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