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

Pressing enter in radPrompt window

2 Answers 219 Views
Window
This is a migrated thread and some comments may be shown as answers.
don
Top achievements
Rank 1
don asked on 10 Dec 2007, 08:32 PM
Dear Telerik,

On your demo site for the RadPrompt feature of RadWindow, I see that when the user presses the "enter" button, my machine beeps and no action is taken. I created a test application and it had the same behavior. Unfortunately, in my production application, pressing enter causes a behavior equivalent to pressing the "Cancel" button in the radPrompt window.

Despite copying my code almost verbatim from the production app to the test app, I cannot recreate the issue. It's not really practical for me to submit my application to you for review, so I was wondering if you had any theoretical ideas of what could interfere with your radPrompt code that would cause your blocking on the "enter" key to take on the equivalent of the Cancel button. I have a number of other Telerik controls, as well as custom Javascript on that page, so I assume there is something else getting in the way.

Thanks for your time and help,

Don

2 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 11 Dec 2007, 11:22 AM
Hi Don,

I am not quite sure what is happening in your production application, but please note that when you click a button to open a RadWindow or a RadWindow dialog like radalert, radprompt, etc. the focus stays on the button. This behavior is not directly related to the RadWindow control and we leave the decision of what to do with the focus to the developers.

What I can suggest is to make sure that when the button is clicked, the focus is set to some other element / removed from the calling button - for example you can call the Javascript blur() method on it.





Kind regards,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
don
Top achievements
Rank 1
answered on 12 Dec 2007, 10:11 PM
Hi Georgi,

Thanks. That pointed me in the right direction to solve two issues. In case anyone reads this later and cares...

The page refresh was actually the form submitting as a result of pressing the enter key in IE. By trapping for the onkeypress event and discarding it if it was triggered by the enter key, I stopped the issue that was the subject of this post.

Secondly, using the blur(), as you suggested, on each link that fires the RadPrompt window stopped the error that happened if the user hit the enter key after the prompt opened, but before clicking on it to give focus. That was due to duplicate window names caused by making the call from the RadGrid.

Thanks!

Don
Tags
Window
Asked by
don
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
don
Top achievements
Rank 1
Share this question
or