gish Posted February 29, 2008 Share Posted February 29, 2008 hi Can anyone tell me if I have a form with only a textbox and a submit button. Is there a way when loading or refreshing the page that the textbox gets highlighted straight away without me having to click or tab in the box. I want to be able to start typing? gish Link to comment https://forums.phpfreaks.com/topic/93619-highlighting-textbox/ Share on other sites More sharing options...
The Little Guy Posted February 29, 2008 Share Posted February 29, 2008 Like so: <body onload="document.form1.myField.focus()"> <form id="form1" name="form1"> <input type="text" name="myField" /> <input type="submit" name="myButton" /> </form> Link to comment https://forums.phpfreaks.com/topic/93619-highlighting-textbox/#findComment-479705 Share on other sites More sharing options...
gish Posted February 29, 2008 Author Share Posted February 29, 2008 thanks that is exactly what i am looking for. Link to comment https://forums.phpfreaks.com/topic/93619-highlighting-textbox/#findComment-479723 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.