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

Put event on SpinButton

4 Answers 81 Views
Input
This is a migrated thread and some comments may be shown as answers.
Jocelyn
Top achievements
Rank 1
Jocelyn asked on 23 Feb 2012, 08:53 PM
Hi,

I have 2 RadNumericTextBox. One contains the weight in Kg and the other in Lbs. I have the event "onkeyup" on each controls that update the right RadNumericTextBox with the correct value. Example: if I write 100kg it will update the Lbs to 220.

My problem is that I use SpinButtons, so the "onkeyup" event is not raised. Can I add an "onclick" event on SpinButtons then I can call my "onkeyup" event?

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 24 Feb 2012, 06:05 AM
Hello,

Try the following javascript to add handler for SpinButtons.
JS:
function OnButtonClick(sender, args)
 {
  $addHandler(sender.SpinUpButton, "onkeyup", functiononkeyup);
 }


Thanks,
Princy.
0
Jocelyn
Top achievements
Rank 1
answered on 24 Feb 2012, 02:40 PM
Well, it doesn't work. It just call the "functiononkeyup" indefinitely.
0
Accepted
Vasil
Telerik team
answered on 28 Feb 2012, 10:41 AM
Hi Jocelyn,

You could use the OnValueChanged client event of the input. It will be fired even if the SpinButtons are clicked.

All the best,
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.
0
Jocelyn
Top achievements
Rank 1
answered on 28 Feb 2012, 02:16 PM
Yes thanks for the help. I am using OnValueChanged and I just call my OnKeyUp function inside!

Thanks again.
Tags
Input
Asked by
Jocelyn
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Jocelyn
Top achievements
Rank 1
Vasil
Telerik team
Share this question
or