Check box selections ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Praneeth Chowda
    New Member
    • Mar 2011
    • 1

    #1

    Check box selections ?

    Hi all
    i have a page having checkboxes like
    i have one parent and for tht parent childs like.,

    chkp
    chkc
    chkc
    chkc
    chkp
    chkc
    chkc
    chkc

    like dynamically these will be genrated based on the number of Assests user will select..

    to disngish these check boxes i used id for parent like "checkBox_Downl oad_Asset_<%= count %>"..
    here count is server variable based on numbr of assets selected..

    and for the child check box i given the id like
    "checkBox_Downl oad_Essence_<%= j %>_<%= count%>"..
    here j is number of essences for the current asset..

    now i need to access the id's in java script to manage the selections of the check box ..

    plz help me out regarding this... i am starter in java script...

    Thnaks in advance........
    Attached Files
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    The ID for the parent checkbox would be "checkBox_Downl oad_Asset_" + count where count is set to the server variable count.

    For the children, use a for loop and access a checkbox like this:
    Code:
    document.getElementById("checkBox_Download_Essence_" + j + "_" + count)
    where j is the loop increment variable.

    Comment

    Working...