Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
903
Cancel client side event if asp.net comparevalidators are not valid
posted

Is it possible to retrieve the state of comparevalidators ?

 

My UltraWebImageButton has a client side function called on click event.

It displays a "loading / please wait" pannel with ajax gif image to let the user wait while searching through the database.


Problem is that I added some CompareValidatore to validate begin and end date and they work fine. My problem is that despite the validators are not ok, the click event function is called by the ultraButton.

How can I retrieve the state of the validators inside the JScript client side function to test I need to display the loading pannel ?

Seems to be a easy question but honestly I don't have an idea on how to retrieve the state of the controls.

 

 

My client side function :

function btnRechercheJS_Click(oButton, oEvent) {
         var obj = window.document.getElementById('<%=pnlProgression.ClientID %>');
        obj.style.display = "block";

        }

 

I have tried something like :

 function btnRechercheJS_Click(oButton, oEvent) {
            var comparaisonDate1 = window.document.getElementById('<%=CompareDateDemande.ClientID %>');
            if (comparaisonDate1.IsValid)
            {
                 var obj = window.document.getElementById('<%=pnlProgression.ClientID %>');

                obj.style.display = "block";
             }
  }