Advertisement

05.18.2008 at 11:44AM PDT, ID: 23412188
[x]
Attachment Details

Uncheck the checked

Asked by panosms in JavaScript, ColdFusion Application Server

Tags: JAVASCRIPT

Hello experts.
On this page i have a solution from expert Hielo how to check all check boxes.
Now i want a help for the opposite Function.(uncheck all the checked)
Here is the code:Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
<script type="text/javascript">
  function popChosen(){
    // declare your array
    var idArray = new Array();
 
    // Then we loop through your table, and get the 
    // id's of the rows that have been ticked
    var rowCount = parseInt(document.getElementById("cbCount").value);
    for(var i = 1; i <= rowCount; i++){
    var oCheck = document.getElementById('checkybox_' +i);
    if(oCheck.checked)idArray.push(oCheck.value);
}
 
    // Convert you array to a string
    var arrayString = idArray.toString();
     // Open your window, passing your array to it
    var url = "http://localhost/domain/test.cfm?idList=" + arrayString;
    window.open(url , "myWindow", "status = 1, height = 300, width = 1000, resizable = 0" );
  }
  
  function CheckAll(v)
  {
        var c = document.getElementsByName(v);
        
        for( var i=0; i < c.length; ++i)
        {
                c[i].checked=true;
        }
  }
</script>
<body>
<table   class="AllResultstable">
  <tr>
    <td colspan="2">
    <table>
   
<cfset EndRow_WADAdboartikel = StartRow_WADAdboartikel + MaxRows_WADAdboartikel - 1>
<cfloop query="WADAdboartikel" startRow="#StartRow_WADAdboartikel#" endRow="#EndRow_WADAdboartikel#" >
<cfquery name="getExtras" datasource="#dsn#">
      SELECT TOP 4 Extra_DE
      FROM Extras_All 
      
     <cfif Len(WADAdboartikel.Besonderheiten)>
      WHERE extra_ID in (#WADAdboartikel.Besonderheiten#)
      <cfelse>
      where 1=2
     </cfif>ORDER BY Extra_ID ASC
    </cfquery>
                <tr>
                  <td colspan="2"></td>
                  <td> </td>
                  <td> </td>
                  <td> </td>
                  <td> </td>
                </tr>
                <tr>
                  <td colspan="2"> 
                    
           <input type="checkbox" name="selection" id="checkybox_<cfoutput>#currentrow#</cfoutput>" value="<cfoutput>#WADAdboartikel.Art_ID#</cfoutput>"/></td>
                    <td>test</td>
       </tr></cfloop>
          <tr>
           <td colspan="2"><input name="" type="checkbox" value="" onclick="CheckAll('selection')">Check all</td>
            <td><input name="myPopButton" type="button" id="myPopButton"   onClick="popChosen();" value="MyButton" /></td>
                  <td> </td>
                  <td> </td>
                  <td> </td>
                </tr>
                </table>
    </td>
  </tr>
</table>
 
<input type="hidden" id="cbCount" value="<cfoutput>#MaxRows_WADAdboartikel
#</cfoutput>"> 
</body>
[+][-]05.18.2008 at 12:01PM PDT, ID: 21593630

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.18.2008 at 12:05PM PDT, ID: 21593653

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]05.18.2008 at 12:06PM PDT, ID: 21593654

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.18.2008 at 12:12PM PDT, ID: 21593669

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: JavaScript, ColdFusion Application Server
Tags: JAVASCRIPT
Sign Up Now!
Solution Provided By: sinoj
Participating Experts: 2
Solution Grade: A
 
 
[+][-]05.18.2008 at 12:13PM PDT, ID: 21593670

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.18.2008 at 12:17PM PDT, ID: 21593682

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.18.2008 at 12:22PM PDT, ID: 21593700

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.18.2008 at 12:25PM PDT, ID: 21593711

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]05.18.2008 at 12:29PM PDT, ID: 21593722

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628