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

RadNumericTextBox change value on client side

3 Answers 286 Views
Input
This is a migrated thread and some comments may be shown as answers.
Covertix
Top achievements
Rank 1
Covertix asked on 16 Jul 2013, 10:13 AM
Hi,

I use RadNumericTextBox:

<telerik:RadNumericTextBox CssClass="SMTPValue" Width="330px" 
runat="server" ID="tbSMTPPort" MinValue="0" MaxValue="65535"
Skin="" HoveredStyle-BackColor="White" FocusedStyle-BackColor="White">
<NumberFormat DecimalDigits="0" GroupSeparator="" />
</telerik:RadNumericTextBox>
I try to change its value on client side using this code:
$find('<%= tbSMTPPort.ClientID %>').set_value(LogServer.Port);

when I check on debug, I see that the value property has changed, but the textbox still displays the old value.

Do you have any idea why?

Thanks!

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 16 Jul 2013, 12:03 PM
Hi

The set_value is a client side method and it cannot be used like a property. Please have a look at the following JavaScript code to check how a value can be set to a RadNumericTextBox using the set_value() method.

JavaScript:
<script type="text/javascript">
    function setradnumerictextboxvalue() {
        var radnumerictextbox = $find('<%=tbSMTPPort.ClientID %>');
        radnumerictextbox.set_value(LogServer.Port);
    }
</script>

Thanks,
Shinu.
0
Covertix
Top achievements
Rank 1
answered on 16 Jul 2013, 02:00 PM
sorry, I just made a mistake here.
I used it like in your example and it didn't work.
0
Eyup
Telerik team
answered on 19 Jul 2013, 01:02 PM
Hello Tzach,

I have prepared a sample web site to demonstrate that the suggested approach works as expected. Please run the attached application and let me know about the result.

Regards,
Eyup
Telerik
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 the blog feed now.
Tags
Input
Asked by
Covertix
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Covertix
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or