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

RadNumericTextBox dynamic css

1 Answer 40 Views
Input
This is a migrated thread and some comments may be shown as answers.
Marcin
Top achievements
Rank 1
Veteran
Marcin asked on 20 May 2011, 10:31 AM
Hello, I'm having issue with css.
I'm adding dynamically css with OnLoad event:
function RequiredOnLoadHandler(sender) {
    if (sender.isEmpty()) {
        $(sender._textBoxElement).addClass("requiredEmpty");
    }
}
But is gone on mouse over. I'm having problem with. It automatically removes that added class. Could you help me, how to avoid removing that css class.?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 20 May 2011, 11:22 AM
Hello Marcin,

I also faced the same issue. I suggest you to attach ClientEvent OnMouseOut and  set the CSS from there  also. Here is the sample code that I tried. Hope this helps you.

Javascript:
<script type="text/javascript">
function OnMouseOut(Sender, args)
{
      if (Sender.isEmpty())
       {
          var textBoxElement = $find("<%= txtbox.ClientID %>")._textBoxElement;
          textBoxElement.className = textBoxElement.className + " requiredEmpty";
       }
}
</script>

Thanks,
Princy.
Tags
Input
Asked by
Marcin
Top achievements
Rank 1
Veteran
Answers by
Princy
Top achievements
Rank 1
Share this question
or