RadDataForm onkeypress

2 posts, 0 answers
  1. MV
    MV avatar
    28 posts
    Member since:
    Dec 2015

    Posted 18 Jan 2017 Link to this post


    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?

  2. Eyup
    Eyup avatar
    3544 posts

    Posted 23 Jan 2017 Link to this post


    Generally, the ASP.NET Panel control provides the DefaultButton property which can be used in such scenarios:

    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.

    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.
Back to Top