HTML, JavaScript And CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingHTML, JavaScript And CSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old August 2nd, 2004, 09:12 AM
asp_kid asp_kid is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: India
Posts: 21 asp_kid User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 48 m 24 sec
Reputation Power: 0
Javascript form element focus

I have three forms in a single page.On top of the page i have three links to get each of the forms.I want to set focus for the first element of each form,

so if i select first form, the curser should be focussed on to the first textbox of that form,

if i select the second form, the curser should be focussed on to the first textbox of that form,

if i select third form, the curser should be focussed on to the first textbox of that form

How can i do that?

Reply With Quote
  #2  
Old August 2nd, 2004, 09:54 AM
selwonk's Avatar
selwonk selwonk is offline
Contributing User
ASP Free Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2004
Posts: 2,942 selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 6 Days 9 h 49 m 28 sec
Reputation Power: 62
Hi

Try:

Code:
document.Form1.Field1.focus();


Obviosuly, change Form1 and Field1 to meaningful names on your page. You could also try:

Code:
document.forms[0].[0].focus();


I think this should focus on the first element of the first form (or maybe it's [0][0]?)

MK

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingHTML, JavaScript And CSS Help > Javascript form element focus


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway