Note that there are some explanatory texts on larger screens.

plurals
  1. POCheckbox states retrieval issue using javascript
    primarykey
    data
    text
    <p>I have check boxes against folders in the tree structure.Can someone suggest me for one issue which I am facing in the check-box states. I <strong>need to retrieve the checked states for the check-boxes from the cookie session</strong> . At the moment I am <strong><em>able to retrieve the ids corresponding to the checked check-boxes from the cookies session. I want to retrieve the checked state of the check-box as well upon pageload()</em></strong> corresponding to those folder ids which I am able to fetch at the moment. I am making use of plain java-script in my entire logic.</p> <p>Is there a way to do it here idArr is the array of the folder ids of the selected checkboxes, can I get the states of the check-boxes as well?Can any one suggest?</p> <pre><code> window.onload=function(){ var test = ReadCookie("Boxer"); alert("ReadCookie: "+test); }; function CreateCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name + "=" + value + expires + "; path=/"; alert("cookie created"); } function ReadCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i &lt; ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } function CheckCookies() { var CurrentCookie = ReadCookie("Boxer"); for (i=0; i&lt;document.CheckList.elements.length; i++) { if (document.CheckList.elements[i].type == "checkbox") { if (CurrentCookie.indexOf(document.CheckList.elements[i].id) &gt; -1) { document.CheckList.elements[i].checked = 1; } } } } </code></pre> <p>/** <strong>I am calling the create cookie method while creation of the checkboxes and passing the array of the checked folder ids corresponding to the check boxes which are in checked state as below</strong>:- **/ </p> <pre><code> CreateCookie("Boxer",idArr,"100"); </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