RadNumeric Textbox Problem

2 posts, 1 answers
  1. Atchut
    Atchut avatar
    51 posts
    Member since:
    Apr 2012

    Posted 02 May 2012 Link to this post

    I am using radnumeric textbox to enter discount at highlevel. If the user changes the discount on other items in the page, I want to clear the RadNumeric Textbox value. I am clearing the textbox using JQuery. On the UI, it is showing as cleared but again when I click on textbox, it is showing the value and on postback also that textbox is showing the same value. Is there any settings I have to change in RadNumeric Textbox
    Here is my Code.

      <telerik:RadNumericTextBox  ID="txtDiscountlevel" runat="server" CssClass="BodyCopy" MaxLength="5" AutoCompleteType="None"  
                                          Type="Number" ShowSpinButtons="false" AllowOutOfRangeAutoCorrect="false" InvalidStyle-Font-Bold="true">
                                          <NumberFormat AllowRounding="false" DecimalDigits="3"  KeepNotRoundedValue="true" GroupSizes="4"/>

                          <telerik:RadNumericTextBox  ID="txtNewPrice" runat="server" MaxLength="10"  AutoCompleteType="None"  MinValue="0"  CssClass="CurPriceTxtbox" 
                                Width="50px"  Type="Number" ShowSpinButtons="false" AllowOutOfRangeAutoCorrect="false" InvalidStyle-Font-Bold="true">
                                          <NumberFormat AllowRounding="false" DecimalDigits="2"  KeepNotRoundedValue="true" GroupSizes="3"/>
                                           <ClientEvents OnValueChanging="ValueChanged" OnError="HandleError"/>

    function ValueChanged(sender, args) {

  2. Answer
    jumpstart avatar
    479 posts
    Member since:
    Nov 2011

    Posted 03 May 2012 Link to this post


    Try this JavaScript to clear your "txtDiscountlevel" RadNumericTextBox control:

    <script type="text/javascript">
        function ValueChanged(sender, args) {
            var txtDiscountlevel = $find("<%= txtDiscountlevel.ClientID %>");
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <telerik:RadNumericTextBox ID="txtDiscountlevel" runat="server" CssClass="BodyCopy"
            MaxLength="5" AutoCompleteType="None" Type="Number" ShowSpinButtons="false" AllowOutOfRangeAutoCorrect="false"
            <numberformat allowrounding="false" decimaldigits="3" keepnotroundedvalue="true"
                groupsizes="4" />
        <br />
        <telerik:RadNumericTextBox ID="txtNewPrice" runat="server" MaxLength="10" AutoCompleteType="None"
            MinValue="0" CssClass="CurPriceTxtbox" Width="50px" Type="Number" ShowSpinButtons="false"
            AllowOutOfRangeAutoCorrect="false" InvalidStyle-Font-Bold="true">
            <numberformat allowrounding="false" decimaldigits="2" keepnotroundedvalue="true"
                groupsizes="3" />
            <clientevents onvaluechanging="ValueChanged" />

    Hope this helps!
  3. DevCraft R3 2016 release webinar banner
Back to Top