Select All function Checkall () {ids.splice (0, 1000000); var flag = $ ("#All_Check"). attr ("checked"); $ (". Ordercheck"). each (function () {if (typeof (flag) = = ' undefined ') flag = FAL Se $ (": Input[type=checkbox]"). attr ("checked", flag); $ (this). Children (). attr ("checked", flag); if ($ (this). Children (). attr ("checked")) {Ids.push ($ (this). attr ("SupplierId")); } else {for (var i in IDs) {if ($ (this). attr ("SupplierId") = = Ids[i]) {Ids.splice (I, 1); Break } } } } ); $ ("#hfids"). Val (IDs); }//Insert order number function Insertordercoder (obj) {if (Obj.attr ("checked")) { Ids.push (Obj.parent (). attr ("SupplierId")); } else {for (var i in IDs) {if (Obj.parent (). attr ("SupplierId") = = Ids[i]) {Ids.splice (I, 1); Break }}} $ ("#hfids"). Val (IDs); }//Click Search to load all checked vendor function Confirmselectedid () {ids.splice (0, 1000000); $ (". Ordercheck"). each (function () {if ($ (). Children (). attr ("checked")) {Ids.push ($ (this). attr ("SupplierId")); } } ); $ ("#hfids"). Val (IDs); } <td style= "Text-align:right;" > <asp:button id= "btsearch" text= "search" runat= "server" style= "HEIGHT:25PX; width:60px; " onclick= "Btsearch_click" onclientclick= "Confirmselectedid ();" /> </td> <th width= "4%" > <input type= "checkbox" Id= "AlL_check "onclick=" Checkall (); "/></th> <td align=" center "> <%--<input type=" c Heckbox "class=" Ordercheck "value= ' <%# eval (" SupplierId ")%> ' Name=" <%# eval ("Productbaseid")%> "onclick= "Insertordercoder ($ (this));"/>--%> <asp:checkbox runat= "Server" cssclass= "Ordercheck" Supplierid= ' <%# Eval ("SupplierId")%> ' onclick= ' Insertordercoder ($ (this)); " /> </td>
JS Select all, insert implementation