No postback when clearing RadNumericTextBox

4 posts, 0 answers
  1. Frank
    Frank avatar
    4 posts
    Member since:
    Jan 2011

    Posted 14 Jan 2011 Link to this post

    Hi,

    I'm using the numerictextbox control with autopostback set to true. This results in postsbacks on changes as expected.
    However when the value was already 0 and the user then clears that field to an empty string no postback occurs. The other way around, from empty string to 0 does post back.

    How can I make sure clearing a 0 value to an empty string still results in a postback?

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

    Posted 18 Jan 2011 Link to this post

    Hello Frank,


    A similar scenario is worked fine for me and postback occurred for both case. I set "AutoPostBack"  property to True and attached "ontextchanged" event to textbox.

    <telerik:RadNumericTextBox AutoPostBack="true" LabelCssClass="riLabel"  MinValue="0"
        ID="RadNumericTextBox1" runat="server"
        Label="hai" ontextchanged="RadNumericTextBox1_TextChanged">
    </telerik:RadNumericTextBox>
     
    Is your scenario different than this?



    -Shinu.
  3. Frank
    Frank avatar
    4 posts
    Member since:
    Jan 2011

    Posted 19 Jan 2011 Link to this post

    Hi Shinu,

    Thanks for your help. It's actually almost the same markup.
    At it's most basic I can reproduce it with this code:

    <form id="form1" runat="server">
    <div>
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
     
    <telerik:RadAjaxPanel runat="server" ID="AjaxPanel1">
        <telerik:RadNumericTextBox runat="server" id="Numeric1" MinValue="0" AutoPostBack="true" ontextchanged="TextChanged"></telerik:RadNumericTextBox>
    </telerik:RadAjaxPanel>
    </div>
    </form>

    Enter value 10, tab out -> Postback
    Enter value 0, tab out -> Postback
    Clear the 0 with delete or backspace, tab out -> No postback, textbox remains blank.

    BUT.. We're using the version 2008 Q3. Maybe this has behaviour has been changed in more recent versions.

    Frank.
  4. Frank
    Frank avatar
    4 posts
    Member since:
    Jan 2011

    Posted 19 Jan 2011 Link to this post

    Upgrading to the latest version has indeed changed the behaviour to what I was expecting.
    Thanks for the help.
Back to Top