This is a migrated thread and some comments may be shown as answers.

Disable Hover on Input!

3 Answers 312 Views
Input
This is a migrated thread and some comments may be shown as answers.
Erik
Top achievements
Rank 1
Erik asked on 27 Jan 2010, 11:09 AM
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"

3 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 29 Jan 2010, 12:55 PM
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" />
<title>RadControls</title>
</head>
<body>
<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;
        this.updateCssClass_Old();
    }
}
</script>
 
</form>
</body>
</html>


Best wishes,
Dimo
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.
0
Zach
Top achievements
Rank 1
answered on 14 Sep 2010, 08:03 PM
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?
0
Dimo
Telerik team
answered on 15 Sep 2010, 07:54 AM
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.

Greetings,
Dimo
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
Tags
Input
Asked by
Erik
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Zach
Top achievements
Rank 1
Share this question
or