Search code examples
javascriptasp.netvalidation-controls

how to fire all validation controls from client side?


In an aspx page I have different validation controls (some required and some custom). Please guide me how to fire all validation controls of page in client side code.

I am aware ValidatorEnable() which accept id of control and enable it. But I want to fire/ exeute all of them using client side code.

Please help.

Thanks


Solution

  • if you have validation groups, use:

    function myFunction(grop)
     {
      if (Page_ClientValidate(grop))
         {
    
            /*do stuff here*/
    
            }
    }
    

    and Page_ClientValidate() without groups )