radconfirm steals focus from calling page

2 posts, 0 answers
  1. Teodorico
    Teodorico avatar
    39 posts
    Member since:
    Feb 2009

    Posted 10 Jul 2009 Link to this post


    I am calling a radconfirm from a web page. After the user clicks on "OK or "Cancel" the radconfirm closes, the callback function gets invoked, but the focus is not returned to the control that had it before opening the radconfirm window.

    I could set it by calling .focus() but I have more than 25 textboxes and I do not want to keep track of the control with the current focus. Using the standard browser confirmation windows keeps the focus were it was before opened.

    Is there any possible solution for this? It forces the user to grab the mouse and click back on the page.


  2. Fiko
    Fiko avatar
    1406 posts

    Posted 13 Jul 2009 Link to this post

    Hi Teodorico,

    This behavior is the expected one in this case, because the radconfirm is rendered on the client as several HTML elements and they are a part of the whole HTML document. The buttons inside the confirm dialog are html elements as well and when you click on them the focus is changed - goes on the clicked element. The browser's windows(alert(), confirm(), open() etc.) are not HTML elements and they are not a part of the page. When you click on a browser's popup you do not click on the HTML document and the focus does not change.
    In this case you need to manually set the focus on the clicked element and for your convenience I have attached an example to this thread.

    I hope this helps.

    Kind regards,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top