3 Replies Latest reply on Jun 18, 2010 6:06 AM by Eswara MoorthyNEC

    How to set cursor focus to <h:selectOneRadio> during onload?

    Eswara MoorthyNEC Newbie



           I need to set cursor focus to radio button during the page loading.



                  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">                                                                    
                  <h:form id="focusForm" >
                      <h:selectOneRadio id="testRadioId" value="">
                          <f:selectItem id="si1" itemLabel="JSF" />
                          <f:selectItem id="si2" itemLabel="JSP" />


      I use firebug. The first item id is :  focusForm:testRadioId:0.

      So i wrote script





      I think this is hard code.

      Is any otherway to set focus to the radio field.

      Help me about this.

      Thanks in advance.