473,666 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting automatic focus on first text item just after running programme

vikas251074
198 New Member
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
7 1717
idsanjeev
241 New Member
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
198 New Member
Thankyou sir,

My problem has been solved.
Jun 3 '08 #3
idsanjeev
241 New Member
Thankyou sir,
My problem has been solved.
glad you got it working.
Regards
Jha
Jun 3 '08 #4
vikas251074
198 New Member
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
241 New Member
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
198 New Member
Yes sir,
I got it.

Thanks and regards,
Vikas
Jun 4 '08 #7
idsanjeev
241 New Member
Yes sir,
I got it.
Thanks and regards,
Vikas
Enjoy
Happy Programming
regards
Jha
Jun 4 '08 #8

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

Similar topics

1
2027
by: reneecccwest | last post by:
hello, is there any way to indicte a cursor on the first text user input when a page loads without using onload in the body tag?
0
1088
by: Dave | last post by:
Hello, I am writing an On-screen keyboard, similar to the one included in windows 2k and XP. The problem I am having is that I need my keyboard to never get the focus, but still be able to process events such as mouse clicks. I have tried setting focus back to the app that just lost the focus, however in smoe application this does not work as the caret/cursor is
2
2119
by: Khadim | last post by:
Hi, I am having this problem with my application that it is not getting itself in taskbar by itself.. i m working on this application for 5 months, don't know what happened at what time that its not getting in focus. If during startup i bring other applications(like internet browser, explorer or Ms-Word) to the focus, my application just starts up and rests in the background without even showing in the takbar. I have even tried...
1
2918
by: Prasad | last post by:
HI all, <!-- ======== This is the division with width & height set to 100% and z-index to -1 =======- --> <div style='position:relative;left:0px;top:0px;width:100%;height:100%;z-index:-1;overflow:auto'> </div>
10
1623
by: jayaprakashbojja | last post by:
Hi, I wrote the code to generate a new row each time when i press tab in the second text box in a row of two text boxes. It's working fine. But my problem is in the new row that is created when i press tab, the cursor should be in the first text box. I wrote the code for that. It's line 10 and 11. It's not working. Please let me know the solution. More over when i press tab in the 2nd text box of first row the cursor is going to ...
2
1499
by: savyatha | last post by:
i have 4 textboxes. after i give some input in the first text box, i need the cursor focussed in the 3rd textbox automatically. plzzzzz any1 help me out how to do this. if possible, give the code for this
0
1462
by: write2jagdeep | last post by:
i Want to change color of text item when got focus in forms builber d2k and revert that color when lost focus. Pls anser it urgently.
5
3752
by: Academia | last post by:
I use to do this: Dim index As Integer = CType(sender, MenuItem).Index but ToolStripMenuItems do not have an Index property so I can set the Tag or MergeIndex property of those items and use that. But that is error prone since changes in the menu require that those values be kept synchronized.
0
8448
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8871
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8783
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8552
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8640
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6198
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2773
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1776
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.