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
425
How to style webeditor control when validation fails?
posted

I tried to change webeditor's style with JQUERY when ASP.NET validation controls fail to validate. I can do it for regular ASP.NET controls such as textbox, but not Infragistics control.

 

Thanks

  • 12679
    posted

    Hi,

    Let me know if you have any questions with this matter.

    Thanks.

  • 12679
    Suggested Answer
    posted

    Hi Hijun,

    The editors are built on top of MS AJAX Framework, also I'm no sure how you are trying to style the controls but you might use code like this one below to access the DOM element and set a color whatever you want :

     

     function  styleEditor() {
                 var  editor = $find('  <%  =WebTextEditor1.ClientID   %>  ' );
                 if  (editor.get_element().style.background != "red" )
                     return  editor.get_element().style.background = 'red' ;
                 editor.get_element().style.background = 'blue' ;    
             }
     

    Hope this helps.