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 Quote 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 Quote 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!! Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.