Click here to Skip to main content
15,889,808 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I'm using Master pages in my application,
and the design of masterpage is like below:

XML
<body id="bodyHomePage" runat="server" class="style12" onkeypress="return eval((event.keyCode==13)?false:true);">
    <form id="form1" runat="server" method="post" action="">
        <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager2" EnablePartialRendering="false" EnableViewState="true" LoadScriptsBeforeUI="false"  runat="server"/>
    <div>
    <asp:UpdatePanel ID="updatePanelMaster" RenderMode="Block"    runat="server"><ContentTemplate>

        <table id="tdTable" runat="server" style="width:1240px;" cellspacing="0" cellpadding="0" align="center">
            <tr>
                <td id="main2" runat="server" valign="top" colspan="2">
                    <div id="main1" runat="server">
                        <uc2:WucTop ID="WucTop1" runat="server" />
                    </div>
                 </td>
            </tr>
            <tr>
                <td id="left1" runat="server"  valign="top">
                    <uc1:WucLeft ID="WucLeft1" runat="server" />
                </td>
                <td id="tdContent" runat="server" style="width:1050px" align="left" valign="top">
                    <table cellspacing="0" cellpadding="0" >
                        <tr>
                            <td valign="top" >
                                <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
                                </asp:ContentPlaceHolder>
                            </td>
                        </tr>
                        <tr>
                            <td valign="top" id="bottom1" runat="server">
                                <uc3:WucBottom ID="WucBottom" runat="server" />
                            </td>
                        </tr>
                    </table>
                </td>

            </tr>




        </table>
        </ContentTemplate></asp:UpdatePanel>
    </div>
    </form>
</body>



my content page is loading in to "Contentplaceholder1".
Now what I want is how to check the status of all the checkboxes in a page in javascript.

I have tried like this
for(i=0; i<document.formName.elements.length; i++){

but no use (i'm unable to get form name in the loop)

Please help me.

thanks & regards
Posted
Comments
Albin Abel 15-Feb-11 3:29am    
you are having the whole body in the master page? so what is there in the content page

1 solution

Have a look at similar article: http://www.sajithmr.me/check-all-checkboxes-javascript/[^]

All you need is to either loop through all the controls of the form and check for the type to move ahead

OR if you are fine with using jQuery then you can use jQuery to directly pick all the checkboxes and then you can move ahead.
jQuery: Checkbox selector[^]
 
Share this answer
 
Comments
Sri9797 15-Feb-11 11:18am    
Thanx sandep
Sergey Alexandrovich Kryukov 15-Feb-11 22:58pm    
My 5,
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900