How to check the checkboxes that are dynamically displayed in the browser

Hi
Here the requirement is ,I am dynamically diaplaying the text boxes based on the data captured from the database.Here depending upon the number characters in Database,related that much of checkboxes will display.How can i provide Javascript client event handling in this without knowing the checkbox ID'.
Needs urgent reply,
Regards
Usman

code to check all check boxes in a page.
<body>
<SCRIPT language=JavaScript>
function doCheckAll()
  with (document.dam) {
    for (var i=0; i < elements.length; i++) {
        if (elements<i>.type == 'checkbox' )
           elements<i>.checked = true;
</SCRIPT>
<FORM  name=dam>
<INPUT  type=checkbox value=1>
<INPUT  type=checkbox value=2>
<INPUT  type=checkbox value=3> <br>
<INPUT  type=checkbox value=4>
<INPUT  type=checkbox value=5>
<INPUT  type=checkbox value=6> <br>
<INPUT  type=checkbox value=7>
<INPUT  type=checkbox value=8>
<INPUT  type=checkbox value=9> <br>
<INPUT onclick=doCheckAll() type=button value="Check all">
<INPUT type=reset value="Reset">
</FORM >
</body>
How you are generating check boxes? if you are generating checkboxes then you would also be generating ids for them. why cant you use them?
Regards
Raja

Similar Messages

Maybe you are looking for