whats the error in this code ?
Whatz wrong in this code ?


**.ASPX CODE ------------------**


    <script type="text/javascript">
    function ConfirmSelection(frm) 
    { 
       for (i=0; i   { 
         //chkSubjectOfInterest is the id of your checkbox control
      
         if (frm.elements[i].name.indexOf('chkSubjectOfInterest') !=-1) 
         { 
           if (frm.elements[i].checked) 
           { 
             return true
           } 
         } 
       } 
       alert('You havent selected an Item yet!')
       return false
    }
    </script>


**CODE BEHIND --------------------**


    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
                Button1.Attributes.Add("onclick", "return ConfirmSelection(this.form);")
    End Sub
whats the error in this code ?
===

Whatz wrong in this code ?


**.ASPX CODE ------------------**


    <script type="text/javascript">
    function ConfirmSelection(frm) 
    { 
       for (i=0; i   { 
         //chkSubjectOfInterest is the id of your checkbox control
      
         if (frm.elements[i].name.indexOf('chkSubjectOfInterest') !=-1) 
         { 
           if (frm.elements[i].checked) 
           { 
             return true
           } 
         } 
       } 
       alert('You havent selected an Item yet!')
       return false
    }
    </script>


**CODE BEHIND --------------------**


    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
                Button1.Attributes.Add("onclick", "return ConfirmSelection(this.form);")
    End Sub