marukochan Posted February 21, 2007 Share Posted February 21, 2007 I have a form with few selections using radio buttons. For example if the user selects to search but did not check the radio button but instead directly go to textbox to write the keyword, my script will checked the radio button, however, the focus will be at the radio button. How do I set focus back to the text box? Part of the script is below <tr> <td> <div align="center"> <input type="radio" name="option" value="search" id="search"> </div></td> <td><label for="search"><em>Title Keyword : <input type="text" name="keyword"></em></label> </td> </tr> Hope everybody understands my question. TQ Link to comment https://forums.phpfreaks.com/topic/39409-solved-set-focus-to-textbox/ Share on other sites More sharing options...
fenway Posted February 21, 2007 Share Posted February 21, 2007 onclick=this.form.elements.text.focus()q Link to comment https://forums.phpfreaks.com/topic/39409-solved-set-focus-to-textbox/#findComment-190233 Share on other sites More sharing options...
marukochan Posted February 21, 2007 Author Share Posted February 21, 2007 Thank you fenway. It worked!! Link to comment https://forums.phpfreaks.com/topic/39409-solved-set-focus-to-textbox/#findComment-190272 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.