Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you need an answer without json2 ( I mean not everybody knows json2 ) you can use this answer; (And if you like it maybe you could rate it :D )</p> <pre><code>&lt;script type="text/javascript"&gt; //Adds new uniqueArr values to temp array function uniqueArr(a) { temp = new Array(); for(i=0;i&lt;a.length;i++){ if(!contains(temp, a[i])){ temp.length+=1; temp[temp.length-1]=a[i]; } } return temp; } //Will check for the Uniqueness function contains(a, e) { for(j=0;j&lt;a.length;j++)if(a[j]==e)return true; return false; } jQuery(document).ready(function($){ $("input[type=checkbox]").each(function () { $(this).change(updateCount); }); updateCount(); function updateCount () { var val; var my_cookie=""; var new_my_cookie=""; var cookie_array; var new_cookie_array; var new_cookie_string=""; var number=0; var temp_cookie=""; my_cookie=$.cookie("chosen_ones"); $(':checkbox:checked').each(function(){ val= $(this).val(); if((val!=null)&amp;&amp;(val!="")){ my_cookie=val+"|"+my_cookie; } }); new_cookie_array=uniqueArr(my_cookie.split("|")); $.each(new_cookie_array, function(index, values) { if((values!="")&amp;&amp;(values!="null")&amp;&amp;(values!=null)){ temp_cookie=values+"|"+temp_cookie; } }); $.cookie("chosen_ones", null); $.cookie("chosen_ones", temp_cookie); var cookie_array=$.cookie("chosen_ones").split("|"); $(':checkbox:not(:checked)').each(function(){ val= $(this).val(); $.each(cookie_array, function(index, values) { if((values==val)&amp;&amp;(values!=null)&amp;&amp;(values!="")&amp;&amp;(values!="null")&amp;&amp;(values!="")){ cookie_array[index]=""; } }); }); new_cookie_array=uniqueArr(cookie_array); $.each(new_cookie_array, function(index, values) { if((values!="")&amp;&amp;(values!=null)&amp;&amp;(values!="null")){ new_cookie_string=new_cookie_string+"|"+values; } }); $.cookie("chosen_ones", null); $.cookie("chosen_ones", new_cookie_string); alert($.cookie("chosen_ones")); var temping_string=$.cookie("chosen_ones"); $("#count").text(temping_string.split("|").length-1); $("#status").toggle(temping_string.split("|").length-1 &gt;= 0); }; }); &lt;/script&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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