selection check of select Box
<p>I'm getting stuck to check StartAll &amp; StopAll</p>

<p>What I want to implement is that -></p>

<p>1> on selecting All checkbox, all the features(except stopall) will be selected and disabled.</p>

<p>2>on selecting Stopall,all the features will be unselected and disabled.</p>

<p>3>B,D &amp; E's value will be slected in the textbox.</p>

<p>Here's the jsfiddle link : <a href="http://jsfiddle.net/bigzer0/PKRVR/5/" rel="nofollow">http://jsfiddle.net/bigzer0/PKRVR/5/</a> </p>

<pre><code>&lt;div align="center" id="checkboxes"&gt;
&lt;input type="checkbox" name="startall" data-name="Startall" class="check" id="check" value="all"&gt; All &amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;input type="checkbox" name="stopall" data-name="Stopall" class="check" id="check" value="stopall"&gt; STOPall &amp;nbsp;&amp;nbsp;
&lt;input type="checkbox" name="apple" data-name="Apple" class="check" id="check" value="a"&gt; Apple &amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;input type="checkbox" name="ball" data-name="Ball" disabled="disabled" checked="checked"  id="check" value="b"&gt; Ball
    &amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;input type="checkbox" name="cat" data-name="Cat" class="check" id="check" value="c"&gt; Cat &amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;input type="checkbox" name="dog" data-name="Dog" checked="checked" disabled="disabled"  id="check" value="d"&gt; Dog
    &amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;input type="checkbox" name="elephant" data-name="Elephant" disabled="disabled" checked="checked"  id="check" value="e"&gt;
    Elephant &amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/div&gt;


&lt;input type="text" name="policyName" id="policyName" title="Policy Name" class="cpolicyname" value="Start" readonly="readonly" &gt;

&lt;input type="text" name="features" title="Policy Features" class="cfeatures" id="features" readonly="readonly" size="60"&gt;
</code></pre>

<p>my (nightmare)jquery :</p>

<pre><code>$(document).ready(function() {
    $('.check').click(function(){
        $("#policyName").val('Start');
        $("#features").val('');
                  $(".check").each(function(){
            if($(this).prop('checked')){

                $("#policyName").val($("#policyName").val() + $(this).val());    
                $("#features").val($("#features").val() + $(this).data('name'));
                }            
        });

     });
});
</code></pre>

<p>Any inputs will be appreciated and welcome.</p>
