RadNumericTextBox Set Value

3 posts, 1 answers
  1. Jibber4568
    Jibber4568 avatar
    28 posts
    Member since:
    Jul 2011

    Posted 05 Apr 2012 Link to this post

    Hi guys, I was hoping you could provide some advice on setting the value of a RadNumericTextBox.

    I have another control (dropdown) that when changed needs to update the RadNumericTextBox.

    The javascript is firing and returning the current value as per below.

    var txtTypeSelected = window["<%=txtOffsetPeriod2.ClientID %>"];
    alert(txtTypeSelected.value);

    However when I then try to set a new value this doesn't appear on screen as the control has had its id set as txtOffsetPeriod2_text.

    txtTypeSelected.value = 1;

    Is there another way I can set the RadNumericTextBox value when the function is called by another controls change event?

    Thanks for the help.
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 05 Apr 2012 Link to this post

    Hello,

     Try the following javascript to set RadNumericTextBox value on  ComboBox selectedindexchange.
    JS:
    function OnClientSelectedIndexChanged(sender, args)
      {
          var RadNumericTextBox1 = $find("<%= RadNumericTextBox1.ClientID %>");
          var txt = sender.get_selectedItem().get_text();
          RadNumericTextBox1 .set_value(txt);
      }

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jibber4568
    Jibber4568 avatar
    28 posts
    Member since:
    Jul 2011

    Posted 05 Apr 2012 Link to this post

    Thanks Princy. Works perfectly.

    Cheers
Back to Top