Dear Telerik,
at the moment we experience an odd behaviour with the RadNumericTextBox component (version 2013.403.35).
In some situations the value on the server is lost. The situation is as following: we have a page with several controls, divided over different (multi)views. One view contains a grid, another view our inputform. The inputform consists of several controls, including a save button.
One such control is the RadNumericTextBox, with type=currency.
When a user enters a value in the box, and also presses the [enter] key, the following happens:
- client side nothing seems to happen, the cursor stays in the textbox (currency character does not show (yet) because the textbox still has the focus. Also form submit on enter has been disabled somehow, I think due another control on the page, like a grid. But this is ok :).
- once the user presses the save button, the value on the server seems to be lost. The value of the box is null.
- after the postback, on the client the value is lost as well
Our problem occurs in both IE and FF browser. I've been able to reproduce the problem in a small example project, but this only does display the behaviour in FF and not IE. But I think it is still a good lead to start with? I suspect it has something to do with the form not submitting, and the way it is prevented. See below for some example code. If you need the whole project, I can provide it.
The project is a simple webforms project with 1 page, Default.aspx:
Code behind:
To reproduce:
- run project in FireFox
- enter a value in the textbox, and press the [enter] key
- press the save button to show the value
Thanks in advance.
at the moment we experience an odd behaviour with the RadNumericTextBox component (version 2013.403.35).
In some situations the value on the server is lost. The situation is as following: we have a page with several controls, divided over different (multi)views. One view contains a grid, another view our inputform. The inputform consists of several controls, including a save button.
One such control is the RadNumericTextBox, with type=currency.
When a user enters a value in the box, and also presses the [enter] key, the following happens:
- client side nothing seems to happen, the cursor stays in the textbox (currency character does not show (yet) because the textbox still has the focus. Also form submit on enter has been disabled somehow, I think due another control on the page, like a grid. But this is ok :).
- once the user presses the save button, the value on the server seems to be lost. The value of the box is null.
- after the postback, on the client the value is lost as well
Our problem occurs in both IE and FF browser. I've been able to reproduce the problem in a small example project, but this only does display the behaviour in FF and not IE. But I think it is still a good lead to start with? I suspect it has something to do with the form not submitting, and the way it is prevented. See below for some example code. If you need the whole project, I can provide it.
The project is a simple webforms project with 1 page, Default.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html>
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
</
head
>
<
body
onkeydown
=
"return (event.keyCode!=13)"
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
runat
=
"server"
ID
=
"RadScriptManager1"
></
telerik:RadScriptManager
>
<
telerik:RadAjaxManager
runat
=
"server"
ID
=
"RadAjaxManager1"
></
telerik:RadAjaxManager
>
<
telerik:RadNumericTextBox
runat
=
"server"
ID
=
"RadNumericTextBox1"
Type
=
"Currency"
></
telerik:RadNumericTextBox
>
<
asp:Button
runat
=
"server"
ID
=
"btnNoPostback"
UseSubmitBehavior
=
"false"
Text
=
"Save"
OnClick
=
"btnNoPostback_Click"
/>
</
form
>
</
body
>
</
html
>
Code behind:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnNoPostback_Click(object sender, EventArgs e)
{
RadAjaxManager1.Alert(string.Format("Button save clicked, value of RadNumericTextbox 1 is: {0}", RadNumericTextBox1.Value));
}
}
To reproduce:
- run project in FireFox
- enter a value in the textbox, and press the [enter] key
- press the save button to show the value
Thanks in advance.