emediastudios Posted November 12, 2007 Share Posted November 12, 2007 I have a contact form in php and want the first text field to be auto selected, my field is called 'First' id= First. is this php or java script? Link to comment https://forums.phpfreaks.com/topic/76927-solved-auto-select-field/ Share on other sites More sharing options...
phpQuestioner Posted November 12, 2007 Share Posted November 12, 2007 most likely javascript is what your looking for - something like this: <script language="javascript"> function readyform() { document.formNameHere.formFieldNameHere.focus(); } window.onload=function() { readyform(); } </script> </head><body> <form name="formNameHere"> <input type="text" name="formFieldNameHere"> </form> Link to comment https://forums.phpfreaks.com/topic/76927-solved-auto-select-field/#findComment-389508 Share on other sites More sharing options...
emediastudios Posted November 12, 2007 Author Share Posted November 12, 2007 most likely javascript is what your looking for - something like this: <script language="javascript"> function readyform() { document.formNameHere.formFieldNameHere.focus(); } window.onload=function() { readyform(); } </script> </head><body> <form name="formNameHere"> <input type="text" name="formFieldNameHere"> </form> Your the man!! Thanks heaps Link to comment https://forums.phpfreaks.com/topic/76927-solved-auto-select-field/#findComment-389510 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.