UnThreaded | Threaded | Whole Thread (18) | Ignore Thread Prev Thread | Prev | Next | Next Thread
Author: DoLoop Big red star, 1000 posts Old School Fool Add to my Favorite Fools Ignore this person (you won't see their posts anymore) Number: of 16395  
Subject: HTML / Javascript question Date: 7/31/2012 3:21 PM
Post New | Post Reply | Reply Later | Create Poll Report this Post | Recommend it!
Recommendations: 0
I have a simple little javascript function in a page that is called when the page loads to set the focus to a specified field on the page.

function setFocus(fldID) {document.getElementById[fldID].focus();}

But, I want to use this to set the focus to an <INPUT> tag which, by definition, does not have an "id". It has only a "name".

Can someone tell me how I go about setting the focus to such a field?
Post New | Post Reply | Reply Later | Create Poll Report this Post | Recommend it!
Print the post  
UnThreaded | Threaded | Whole Thread (18) | Ignore Thread Prev Thread | Prev | Next | Next Thread

Announcements

Invest Better Hub
Take advantage of our newest free service, Invest Better!
New Fool-Branded Credit Card Available!
How does your card compare to ours?
Post of the Day:
Macro Economics

Book Review: "The World Before Yesterday"
What was Your Dumbest Investment?
Share it with us -- and learn from others' stories of flubs.
Facebook Fool Fan Club
Be a fan of the Fool over on Facebook!
Community Home
Speak Your Mind, Start Your Blog, Rate Your Stocks

Community Team Fools - who are those TMF's?
Get the Fool Phone App
Save and share content, zero in on sectors, podcasts, and much more!
Contact Us
Contact Customer Service and other Fool departments here.
Work for Fools?
Winner of the Washingtonian great places to work, and "#1 Media Company to Work For" (BusinessInsider 2011)! Have access to all of TMF's online and email products for FREE, and be paid for your contributions to TMF! Click the link and start your Fool career.
Advertisement