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

Numeric Textbox losing css class on mouse over

1 Answer 171 Views
Input
This is a migrated thread and some comments may be shown as answers.
Hans de Gier
Top achievements
Rank 1
Hans de Gier asked on 03 Oct 2011, 04:36 PM
Hello Telerik support,

We have several numeric textboxes throughout our web application and we added our own styling to them through adding a css class to them ("moneybox"). However, they lose this added class after a mouse over.
I think the problem lies with the fact that you change the css classes with Javascript on mouse over and mouse out, and then forget to re-attach the user-added css class.
How can we solve this problem? Besides the solution we have implemented now, which is, adding the css class again after the mouse over through the use of Javascript (jquery), as you see below:

<Telerik.Web.UI.RadNumericTextBox ID="tbActivityValue" Culture="nl-NL" CssClass="moneybox" NumberFormat-DecimalDigits="2" runat="server" MinValue="0" TabIndex="1"></Telerik.Web.UI.RadNumericTextBox>


Added jquery:
/* Add class moneybox to the Telerik Numeric Textboxes in the repeater */
        $(".numerictextboxholder .riTextBox.riEnabled.sfi_textbox").addClass("moneybox");
        $(".numerictextboxholder .riTextBox.riHover").mouseout(function() {
            $(".numerictextboxholder .riTextBox.riHover").addClass("moneybox");
        });
        $(".numerictextboxholder .riTextBox.riEnabled.sfi_textbox").mouseout(function() {
            $(".numerictextboxholder .riTextBox.riEnabled.sfi_textbox").addClass("moneybox");
        });
        $(".numerictextboxholder .riTextBox.riHover").mouseover(function() {
            $(".numerictextboxholder .riTextBox.riHover").addClass("moneybox");
        });
        $(".numerictextboxholder .riTextBox.riEnabled.sfi_textbox").mouseover(function() {
            $(".numerictextboxholder .riTextBox.riEnabled.sfi_textbox").addClass("moneybox");
        });
        $(".numerictextboxholder .riTextBox.riFocused").blur(function() {
            $(".numerictextboxholder .riTextBox.riEnabled.sfi_textbox").addClass("moneybox");
        });
        $(".numerictextboxholder .riTextBox.riEnabled.sfi_textbox").blur(function() {
            $(".numerictextboxholder .riTextBox.riEnabled.sfi_textbox").addClass("moneybox");
        });

1 Answer, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 06 Oct 2011, 09:03 AM
Hi,

This is expected to happen because the NumericTextBox applies different styles on hover, focus, blur, and etc. Check this help topic for more information:
http://www.telerik.com/help/aspnet-ajax/input-styles.html
Also see my reply in this forum thread:
http://www.telerik.com/community/forums/aspnet-ajax/input/radtextbox-changing-color-on-mouseover-for-no-reason.aspx

Kind regards,
Vasil
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Input
Asked by
Hans de Gier
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Share this question
or