When the page is laoded my visitors must click on the textfield to enter the search string.
How to automatise it, when the page loads you only need to type (because the cursor is in the the first textfield on the page)
Is this better done troug PHP or javascript...Better way no matter which is if possible.
Thanks ahead.[/big_search]
[SOLVED]How to focus cursor in textfield on page load PHP
Moderator: General Moderators
[SOLVED]How to focus cursor in textfield on page load PHP
Last edited by Calimero on Tue Jun 15, 2004 5:32 pm, edited 1 time in total.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
only javascript would be able to do this..
you need to focus() the field onload.. like this:
you need to focus() the field onload.. like this:
Code: Select all
<body onload="document.forms.formname.fieldname.focus()">
<form name="formname"><input type="text" name="fieldname"></form>I'll try it thanks, THIS SHORE WAS QUICK
AND SOMETHING IN THE BODY ... 