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

RadDataForm onkeypress

1 Answer 21 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
MV
Top achievements
Rank 1
MV asked on 18 Jan 2017, 04:30 PM

Hi,

I have a dataform and I'm trying to use the 'Enter' key to save. On my page, I have 3 textboxes and a button (default) that are used to populate the dataform. When my dataform is in edit mode, I press the 'Enter' key and it will not save because my default button is the Search button. 

I'm using javascript on every single textbox inside my dataform to capture onkeypress and cancel the Search. But, if I click outside the textboxes inside my dataform, and I press 'Enter' it will search again.

I've tried to capture onkeypress in a <div> using JQuery but it doesn't work.

Any ideas?

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 23 Jan 2017, 11:32 AM
Hi,

Generally, the ASP.NET Panel control provides the DefaultButton property which can be used in such scenarios:
https://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.panel.defaultbutton(v=vs.110).aspx

Place the DataForm inside the Panel and set its DefaultButton property to the UniqueID of your Button and the Enter key should successfully submit the changes.

Regards,
Eyup
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
DataForm
Asked by
MV
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or