But ... before you do that ... have you looked at all the validation controls that ASP.NET provides? I still use custom JavaScript validation mostly only when I need validation over AJAX. For the most part, the ASP.NET validation controls make life pretty easy -- easier than writing custom JavaScript.
∞ Andy Badera ∞ +1 518-641-1280 ∞ This email is: [ ] bloggable [x] ask first [ ] private ∞ Google me: http://www.google.com/search?q=andrew%20badera On Thu, Oct 1, 2009 at 3:09 AM, Cerebrus <[email protected]> wrote: > > You could try something like iterating in an array, for instance > > --- > function IsValid(elementSet) > { > for (var idx in elements) > { > var el = elements[idx]; > > // Validate el. > ... > } > } > > Sample invocation: > > IsValid(['TextBox1','TextBox2','TextBox3']); > --- > > On Sep 30, 10:21 pm, himanshu <[email protected]> wrote: >> document.getElementById("<%=TextBox1.ClientID%>").value; >> >> we ryt this in script. >> is there any way from which i can call one javascript function for all >> texboxes which need same kind of validation.i mean by parameter like >> >> function isvalid(value) >> { >> validation >> >> } >> >> could call it like isvalid(textbox1) >> >> is it possible >> if yes how? >
