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"; } }
Hi Yannick,
To learn about architecture of validators, I suggest you to drop on temporary page textbox (or few of them) and validator (or few of them) and run it in debug mode. Find and open "Page_Validator..." (embedded) script within Script Documents or similar option available in VisualStudio Debug->Windows, and look at content of that file.
You probably will find following objects which can be useful for you. Particularly Page_IsValid, Page_Validators, etc. You also may set break points at various places and check how validators work.
To get acces to (all) validators, you may do something like
if(typeof Page_Validators != 'object') return;var vals = Page_Validators;for(var i = 0; i < vals.length; i++){ var val = vals[i]; alert('id=' + val.id + ' valid=' + val.isvalid + ' text=' + val.innerHTML + ' target=' + val.controltovalidate); // etc.}
Hope it will help.
Thanks for your answer Viktor, I checked MSDN page as well and finally achieve to enable JS-debug mode in IE and Firefox :)
But apparently, Infragistics UltraWebImageButton clientside's click event is performed before the page validation ? (in debug, all validators are valid in the ClientSide called method, then the validators messages appeared on my ASPX page ?
Is there a way to validate the page and check it in the code of an UltraWebImageButton ?
Thanks for your feeback
The postback of WebImageButton does trigger validation. It is similar to postback triggered by a TextBox with enabled AutoPostBack or to Button with disabled CausesValidation property.
Hi Viktor,
I checked with your support department. It appears this is working perfectly under Internet Explorer but not under Firefox, but it is the same with standard ASP button, not only with the infragistics controls.
So maybe there's a bug in FF preventing the trigger validation before the postback of the page ?
Could you please check. In the meantime, I will try to find the provided application/video Infragistics team sent me two weeks ago and post it here.