Disable Hover on Input!

4 posts, 0 answers
  1. Erik
    Erik avatar
    22 posts
    Member since:
    Apr 2009

    Posted 27 Jan 2010 Link to this post

    I've created a custom validation class, when the class throws an error the input that caused the error gets an error class added to the CssClass property!

    My problem is that the "Hover" function removes this "error" class, is there any way possible to remove the Hover function on the RadTextBox Controller?

    I'm adding the error css class like this:
    MobileTextBox.CssClass += " error"
  2. Dimo
    Dimo avatar
    8322 posts

    Posted 29 Jan 2010 Link to this post

    Hi Erik,

    Here is how to disable the functionality, which changes the RadInput CSS class on hover. Note that the custom Javascript must be included or registered in the <body>, so that it is parsed after the embedded scripts, which are registered in the <head>.

    <%@ Page Language="C#" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    <head runat="server">
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <telerik:RadTextBox ID="RadTextBox1" runat="server" />
    <script type="text/javascript">
    if (typeof(Telerik) != "undefined" && typeof(Telerik.Web.UI.RadInputControl) != "undefined")
        Telerik.Web.UI.RadInputControl.prototype.updateCssClass_Old = Telerik.Web.UI.RadInputControl.prototype.updateCssClass;
        Telerik.Web.UI.RadInputControl.prototype.updateCssClass = function()
            this._hovered = false;

    Best wishes,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Telerik UI for ASP.NET Core is out
  4. Zach
    Zach avatar
    7 posts
    Member since:
    Jun 2004

    Posted 14 Sep 2010 Link to this post

    Sorry to piggyback on this thread, but I'm having the exact same problem only for the RadMaskedTextBox.  I tried the suggested solution and it did not appear to work.  I then changed all instances of RadInputControl to RadMaskedTextBox and I got JS errors on updateCssClass_Old and updateCssClass.  Using firebug to inspect the object, I see that the RadMaskedTextbox does not have those functions.  How can I prevent hover from removing my error class?
  5. Dimo
    Dimo avatar
    8322 posts

    Posted 15 Sep 2010 Link to this post

    Hi Geoff,

    RadInputControl is a base type and RadMaskedTextBox is a RadInputControl. You don't have to modify the Javascript.

    If the problem persists, please send a simple demo, so that we can get a better idea of your scenario.

    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top