corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » help from webmasters...


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author help from webmasters...
Bart
Member

Registered: 19th Aug 02
Location: Midsomer Norton, Bristol Avon
User status: Offline
3rd Dec 05 at 23:17   View User's Profile U2U Member Reply With Quote

i have a webpage which has a search box right at the top of the page.
How can i make it so that the cursor is in the search box at the begining when the page loads?

Adam
Ally
Member

Registered: 2nd Jul 03
Location: Pontypool Drives: a Skoda
User status: Offline
4th Dec 05 at 00:16   View User's Profile U2U Member Reply With Quote

http://javascript.about.com/library/blmousepos.htm
James
Member

Registered: 1st Jun 02
Location: Surrey
User status: Offline
4th Dec 05 at 00:21   View User's Profile U2U Member Reply With Quote

Is the page just in html? If so you can do it client side by setting the focus using javascript.

If your using something that needs be parsed on a server i.e PHP or ASP then it would be better to set the focus server side using that language
James
Member

Registered: 1st Jun 02
Location: Surrey
User status: Offline
4th Dec 05 at 00:30   View User's Profile U2U Member Reply With Quote

Well saying that, both server side and client side have pros and cons but working for barclays we have to use server side as much as poss because we cant rely on client PCs

[Edited on 04-12-2005 by James]
MikeLamb
Member

Registered: 23rd Sep 03
Location: Crowthorne Drives: Veccy SRI
User status: Offline
4th Dec 05 at 10:25   View User's Profile U2U Member Reply With Quote

How the hell can you set that serverside?????

Every page is HTML, whether its produced serverside or not doesnt make a difference!

put this in the head:
<script>

function bart(){document.myformname.searchfield.focus();}

</script>

add this to the <body> tag
onLoad=bart()
eg:
<body onLoad=bart()>

Obviously replace "myformname" with the name of the form and "searchfield" with the name of the field you want to focus on.

[Edited on 04-12-2005 by MikeLamb]

 
New Topic

New Poll

Corsa Sport » Message Board » Off Day » help from webmasters... 23 database queries in 0.0138731 seconds