JavaScript - ASP.net - Loop through all controls on an asp pannel
<p>Is there any way for me too loop though all controls on an asp.net pannel, and for each of the controls check the type to see if it is of asp type TimeInput?</p>

<p>The JS basicly needs to replicate this serverside VB.net code</p>

<pre><code> 'this is checking that something has been entered into at least one of the time input boxes
Protected Sub valCusAllTextBox_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles valCusAllTextBox.ServerValidate
    'When the Save or Submit button is clicked the Page.IsValid() command causes the "valCusAllTextBox" custom validator control
    '(which was dragged on to the page) to call this event - where we do our customised error checking
    args.IsValid = False        'args.IsValid is a system function
    'check all controls within the Overtime Claim panel
    For Each ctrl As Control In pnlOvertimeClaim.Controls
        If TypeOf ctrl Is TimeInput Then
            If CType(ctrl, TimeInput).TimeInMinutes &lt;&gt; 0 Then
                args.IsValid = True
                Exit For
            End If
        End If
    Next
    If txtOnCallAllow.Text.Trim() &lt;&gt; "" Then
        args.IsValid = True
    End If
    If txtMealAllow.Text.Trim() &lt;&gt; "" Then
        args.IsValid = True
    End If
End Sub
</code></pre>
