RadNumericTextBox change value on client side

4 posts, 0 answers
  1. Tzach Kaufmann
    Tzach Kaufmann avatar
    95 posts
    Member since:
    Aug 2008

    Posted 16 Jul 2013 Link to this post

    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!
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 16 Jul 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Tzach Kaufmann
    Tzach Kaufmann avatar
    95 posts
    Member since:
    Aug 2008

    Posted 16 Jul 2013 Link to this post

    sorry, I just made a mistake here.
    I used it like in your example and it didn't work.
  5. Eyup
    Admin
    Eyup avatar
    3015 posts

    Posted 19 Jul 2013 Link to this post

    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.
Back to Top