By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,045 Members | 1,339 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,045 IT Pros & Developers. It's quick & easy.

Getting automatic focus on first text item just after running programme

vikas251074
100+
P: 198
Can I get automatic focus on first text item just after running programme? Because when I run the programme, there is no focus on any text item at the first instant. I have to use mouse to go to first text item.
So Can I get automatic focus on first text item just after running programme?

Thanks and regards,
Vikas
Jun 3 '08 #1
Share this Question
Share on Google+
7 Replies


idsanjeev
100+
P: 241
please try

Expand|Select|Wrap|Line Numbers
  1. <form name="myform">Name:  <input type="text" name="fieldname" size=10></form>
Insert into body Tag
Expand|Select|Wrap|Line Numbers
  1.  OnLoad="document.myform.fieldname.focus();"
regards
jha
Jun 3 '08 #2

vikas251074
100+
P: 198
Thankyou sir,

My problem has been solved.
Jun 3 '08 #3

idsanjeev
100+
P: 241
Thankyou sir,
My problem has been solved.
glad you got it working.
Regards
Jha
Jun 3 '08 #4

vikas251074
100+
P: 198
Excuse me sir,

This method does not work for array type inputs text. Suppose, I have four rows for mat, cmp_sr_no, dept_sr_no, qty, wt, rem fields. The number of row is dynamic as per the requirement of user. When this page loads, the focus should be on first row of mat field. How can this be done?

Thanks and regards,
Vikas
Jun 4 '08 #5

idsanjeev
100+
P: 241
Excuse me sir,

This method does not work for array type inputs text.When this page loads, the focus should be on first row of mat field. How can this be done?

Thanks and regards,
Vikas
plese try to replce body tag with

Expand|Select|Wrap|Line Numbers
  1. <body onLoad="document.myform.mno[0].focus();">
Jha
Jun 4 '08 #6

vikas251074
100+
P: 198
Yes sir,
I got it.

Thanks and regards,
Vikas
Jun 4 '08 #7

idsanjeev
100+
P: 241
Yes sir,
I got it.
Thanks and regards,
Vikas
Enjoy
Happy Programming
regards
Jha
Jun 4 '08 #8

Post your reply

Sign in to post your reply or Sign up for a free account.