This is a migrated thread and some comments may be shown as answers.

No postback when clearing RadNumericTextBox

3 Answers 132 Views
Input
This is a migrated thread and some comments may be shown as answers.
Frank
Top achievements
Rank 1
Frank asked on 14 Jan 2011, 05:01 PM
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.

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 18 Jan 2011, 01:25 PM
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.
0
Frank
Top achievements
Rank 1
answered on 19 Jan 2011, 11:22 AM
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.
0
Frank
Top achievements
Rank 1
answered on 19 Jan 2011, 12:44 PM
Upgrading to the latest version has indeed changed the behaviour to what I was expecting.
Thanks for the help.
Tags
Input
Asked by
Frank
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Frank
Top achievements
Rank 1
Share this question
or