Can't set focus on a Radbutton Imagetype

2 posts, 0 answers
  1. Luis
    Luis avatar
    3 posts
    Member since:
    Mar 2011

    Posted 07 Mar 2011 Link to this post

    hello there:

    I Replace standard asp.net buttons for radbuttons on my website and some focus client scripts stopped working due button type has changed. Dou you know how to set focus on Image type Radbuttons. Because I'm using some radcomboboxes linked to autocomplete text property and I set up a script focusing a button on the RadComboBox client events  "onclientdropdownclosing" and "onclientdropdownclosed".

    this is my current focus client event used on RadcomboBoxes:

     function setFocusTobtnBuscaCliente() {
                       document.Form1.btnBuscaCliente.focus();
                   }


    Thanks in advance for any help provided!!!
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 07 Mar 2011 Link to this post

    Hello Luis,

    RadButton creates a client-side object with the ClientID of the button. You can obtain the reference using the $find and then can set the focus as shown below.

    Javascript:
    function setFocusTobtnBuscaCliente()//calls on OnClientDropDownClosing
       {
           var btn = $find('<%=RadButton1.ClientID%>');
           btn.focus();//setting focus
       }

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top