|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
ASP/VBScript Forms
Could someone please tell me how I get the cursor to focus on the top box when a page is opened. I have a number of pages which request information and every time the paeg opens you have to place the cursor in the top box. kind regards emma |
|
|||
|
you'll need to do this with javascript as opposed to ASP as it's actually done by the clients browser when they load the page. The onload event of the body tag should do it e.g.
<body onload="javascript: somefield.focus();"> This should do what you need Mike |
|
|||
|
Thank you for your reply.
Im using Dreamweaver templates and I cannot put an editable region around the body tag. Is there anyway I can do this within the form within the head of the document? |
|
|||
|
you can place the following javascript in the page anywhere after the form
<script type="text/javascript"> <!-- document.form_name.field_name.focus(); --> </script> replacing form_name and field_name as appropriate. not the best solution but it should work. note it has to be after the form in the html, otherwise you will get javascript errors hope this helps mike |
|
|||
|
It works perfectly.
Thank you so much for your help. Kind regards Emma |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |