Well, this approach should work, but I'd try to go with a <asp:CustomValidator>.
Does that not do what you need?
-Brock
DevelopMentor
http://staff.develop.com/ballen
> I have a simple aspx form where a few fields are validated with
> RequiredFieledValidators. They work fine..
>
> Now I needed to add an own onclick validation that checks something
> else and that has a errormessage that shoudl popup but it seems like
> I'm overwriting the onclick generated by .NET and the validations are
> not happening.
>
> I add the onclick as the last row in Page_Load
> btnSave.Attributes.Add("onclick", "javascript:return CheckInactive('"
> & Lang.GetText("customer_inactivewarning") & "');")
>
> I'm thinking I need to add this at a different time to NOT overwrite
> the onclick generated by .NET?
>
> please help/
>
> Lars
>