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

RadNumericTextbox

7 Answers 31 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
El
Top achievements
Rank 1
El asked on 22 Apr 2010, 12:11 PM
I am trying to set the Box2's value to (100 - Box1.value). I tried several things but it seems that OnTextChanged does not work as expected. I get method not supported error. In other cases i get an error } is missing. Any ideas? Link? thanks

7 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 22 Apr 2010, 12:38 PM
Hello El,

I tested the described scenario, however was not able to replicate the issue you are facing. Please find attached a sample project that works as expected.

Let us know if it helps and if further assistance is needed.

Kind regards,

Maria Ilieva
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.
0
El
Top achievements
Rank 1
answered on 22 Apr 2010, 12:44 PM
No it works fine on the server-side. I want to update the radnumerictextbox on client-side.
As soon as you change the value in the Box1 the Box2 should be updated with 100 - Box1.value. So it would be nice if i don't need to wait that Box1 gets lost the focus. Thanks
0
Maria Ilieva
Telerik team
answered on 23 Apr 2010, 12:44 PM
Hi El,

In order to chnage the value of the second input during the first box entering you should apply the action (javascript) to the OnValueChanging Event


Kind regards,
Maria Ilieva
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.
0
El
Top achievements
Rank 1
answered on 23 Apr 2010, 10:17 PM
Ok it makes sense but, i am not very skillful in Javascript so would you please make a little favor to me and give me the script for this pseudo code:

function1(sender, eventArgs){
 Box2.value = 100 - Box1.value;
}
function2(sender, eventArgs){
 Box1.value = 100 - Box2.value;
}

Thank you very much in advance
0
Dimo
Telerik team
answered on 26 Apr 2010, 12:44 PM
Hi El Dim,

Improving your Javascript skills a little will make using RadControls and the ASP.NET AJAX client library a lot easier for you, so I recommend doing it. With regard to this particular case, please refer to the following pages:

http://demos.telerik.com/aspnet-ajax/input/examples/programming/clientside/apievents/defaultcs.aspx

http://www.telerik.com/help/aspnet-ajax/input_clientsidebasics.html

http://www.telerik.com/help/aspnet-ajax/input_clientsideradnumerictextbox.html


Best wishes,
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.
0
El
Top achievements
Rank 1
answered on 26 Apr 2010, 12:49 PM
Thanks for the links but i found them not very useful for what i am trying to do.
If there is someone willing to help me with this it would be much appreciated!

I guess that for JS gurus this is a very simple task. I just need to assign value to another radnumeric textbox according the value of the first one. That's all i need.

Thanks in advance!
0
Dimo
Telerik team
answered on 29 Apr 2010, 06:59 AM
Hello El Dim,

Here is an example for you. However, I will appreciate if you tell us what in the provided help articles and demos was hard for you to understand and implement. In this way, we can improve our documentation.


<%@ 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:RadNumericTextBox ID="RadNumericTextBox1" runat="server" Label="TB1">
    <ClientEvents OnValueChanged="ValueChanged1" />
</telerik:RadNumericTextBox>
 
<br /><br />
 
<telerik:RadNumericTextBox ID="RadNumericTextBox2" runat="server" Label="TB2">
    <ClientEvents OnValueChanged="ValueChanged2" />
</telerik:RadNumericTextBox>
 
<script type="text/javascript">
 
function ValueChanged1(sender, args)
{
    var tb2 = $find("<%= RadNumericTextBox2.ClientID %>");
    tb2.set_value(100 - args.get_newValue());
}
 
function ValueChanged2(sender, args)
{
    var tb1 = $find("<%= RadNumericTextBox1.ClientID %>");
    tb1.set_value(100 - args.get_newValue());
}
 
</script>
 
</form>
</body>
</html>


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
General Discussions
Asked by
El
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
El
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or