jwk811 Posted January 4, 2007 Share Posted January 4, 2007 how can i make it so the user can just start typing in a text box when they get to a page, the "I" cursor already in it ready to be typed in? Quote Link to comment Share on other sites More sharing options...
fooDigi Posted January 4, 2007 Share Posted January 4, 2007 although this is not specifically a php issue, you can accomplish it by the following...document.your_form_name.your_input.setFocus();i think this will work. Quote Link to comment Share on other sites More sharing options...
fooDigi Posted January 4, 2007 Share Posted January 4, 2007 sorry...document.your_form_name.your_input.focus();not...document.your_form_name.your_input.setFocus(); Quote Link to comment Share on other sites More sharing options...
jwk811 Posted January 4, 2007 Author Share Posted January 4, 2007 sweet thanks Quote Link to comment Share on other sites More sharing options...
jwk811 Posted January 4, 2007 Author Share Posted January 4, 2007 i have it between the head tags.... but im having a problem.. i dont know what it is but when i did it it worked and it came up on focus and then i tried doing it again and it didnt work and its still not working.. i dont understand Quote Link to comment Share on other sites More sharing options...
chronister Posted January 4, 2007 Share Posted January 4, 2007 place that bit below your input field you want to focus.<script type="text/javascript" >document.your_form_name.your_input.focus();</script>I am not real good with javascript, but from when I used this line for the exact same purpose, it seemed that the field had to be sent to the browser first before it would call focus to it.Try that Quote Link to comment Share on other sites More sharing options...
fenway Posted January 5, 2007 Share Posted January 5, 2007 After the </body> tag would be best. Quote Link to comment 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.