Default Value RadNumericTextbox

4 posts, 0 answers
  1. benitolopez_sistemas
    benitolopez_sistemas avatar
    25 posts
    Member since:
    Jan 2007

    Posted 02 May 2010 Link to this post

    I have 5 RadNumericTextbox, but I need when the user clears the input area it must always have a default value of "0", I don't need a validator, only I need before the callback is made the RadNumericTextboxes are filled with this default value.

    Thanks.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 03 May 2010 Link to this post

    Hello,

    One suggestion would be attaching the 'OnBlur' client event and resetting the textbox value to zero when user clears the value. Here is the example.

    ASPX:

     
    <telerik:RadNumericTextBox ID="RadNumericTextBox1" Value="0" runat="server">  
        <ClientEvents OnBlur="OnBlur" />  
    </telerik:RadNumericTextBox> 

    JavaScript:

     
    <script type="text/javascript">  
        function OnBlur(sender, args) {  
            if (sender.get_value() == "") {  
                sender.set_value("0");  
            }  
        }  
    </script>  
     

    -Shinu.

  3. benitolopez_sistemas
    benitolopez_sistemas avatar
    25 posts
    Member since:
    Jan 2007

    Posted 03 May 2010 Link to this post

    Thanks.

    One more question, the code you share works fine, but I have a radnumerictextbox with autopostback=true. Without your code, the loading image shows(before) and hides(after) the postback, but with your code the images shows(before) and it still shows(after) the postback.

    Can you help please?

    This is the code for the panel loading:
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel3" runat="server" Skin="" Transparency="30" OnClientShowing = "fnS" OnClientHiding = "fnH" MinDisplayTime="1000"
                <div class="loading"
                    <asp:Image ID="Image1" runat="server" ImageUrl="~/img/loading1.gif" AlternateText="loading" /> 
                </div> 
            </telerik:RadAjaxLoadingPanel> 

    The javascript code is:
    function fnS(sender, args) { args.get_loadingElement().style.border = "1px solid grey"; args.set_cancelNativeDisplay(true); $telerik.$(args.get_loadingElement()).show("slow"); }  
     
    function fnH(sender, args) { args.get_loadingElement().style.border = "1px solid blue"; args.set_cancelNativeDisplay(true); $telerik.$(args.get_loadingElement()).hide("slow"); } 
     



  4. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 04 May 2010 Link to this post

    Hello,

    I hope the aproach of explicitly showing/hiding the RadAjaxLoadingPanel in OnRequestStart/OnResponseEnd methods will help you in achieving this.

    The following documentation describes more on this topic:

    Show and hide loading panel explicitly

    Regards,
    Shinu.

Back to Top