Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 30th, 2004, 06:29 PM
Authorized User
 
Join Date: Oct 2003
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to get insertion point to focus in textbox?

I have tried everything but can't get the mouse insertion pointer to focus in the text box when the page opens.

Here is a link to the page so you can look at the source code.

I sure would like to get this working... any help would be appreciated :)

http://www.networkdriven.com/glossar...et_routing.htm

Rudy
__________________
Rudy
 
Old April 30th, 2004, 06:38 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

OK, first off you need to have a form with an ID and the element you want to focus on with an ID. Then to focus on the element you would add an onLoad attribute to the body which would look like this:

<body onload='document.forms.your_forms_id.your_elements _id.focus()'>


Hope this helps you,

Snib

<><
 
Old April 30th, 2004, 06:45 PM
Authorized User
 
Join Date: Oct 2003
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Snib for your reply...
I did not write this form and I'm not sure it has an ID and not sure how to focus on the element I want to onload. If you were to open the link you might be able to tell me if this form that has and ID?

Thanks anyway, but this ones probably a bit over my head :(

Quote:
quote:Originally posted by Snib
 OK, first off you need to have a form with an ID and the element you want to focus on with an ID. Then to focus on the element you would add an onLoad attribute to the body which would look like this:

<body onload='document.forms.your_forms_id.your_elements _id.focus()'>


Hope this helps you,

Snib

<><
Rudy





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set focus on particular char in textbox anil.goyal ASP.NET 1.0 and 1.1 Basics 1 June 9th, 2008 12:54 PM
How to check if a textbox has focus using c#? Hannibal ASP.NET 2.0 Basics 0 May 15th, 2007 01:02 AM
focus insertion point in flash movie larry Flash (all versions) 4 January 5th, 2006 07:30 PM
How to focus the insertion point in a text box larry Javascript How-To 3 April 2nd, 2004 07:12 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.