473,395 Members | 1,941 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Focus object on load.

24
how to set the tabindex as default???
mean when i load the page, it focus the text box which are hving the default tabindex number ...

thx
Jan 17 '07 #1
4 1389
shweta123
692 Expert 512MB
Hi,

On body onload event you can call the function which will set the focus on some default control.
e.g

function setFocus()
{
document.getElementByID("textbox1").focus();
}

It has nothing to do with the Tabndex.


}
Jan 17 '07 #2
Nicolas
24
=.="
oic....
thnaks
so that...the text box i need to add id = "TextBoxName"...???
if i don't want to add still can use this function..??
Jan 18 '07 #3
shweta123
692 Expert 512MB
Hi,

Are you talking about getElementById function? there you have to give the Id of the Control whatever it is!


Shweta
Jan 18 '07 #4
acoder
16,027 Expert Mod 8TB
=.="
oic....
thnaks
so that...the text box i need to add id = "TextBoxName"...???
if i don't want to add still can use this function..??
Using getElementById is the preferred method if you set the id of the text box, but if you must, you can use the following syntax:
Expand|Select|Wrap|Line Numbers
  1. document.formname.textboxname.focus();
Jan 18 '07 #5

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

Similar topics

0
by: Miquel | last post by:
Hi all. I felt frustrated when developing an 'UserControl' derivated from textBox, because sequence event (and Validate event) seems to fail. I Always thought my code was wrong. But after...
10
by: tshad | last post by:
I have a page where I give focus to the first textbox on my page: <body onLoad="document.forms.firstName.focus();"> I also go and check the status of some data when I exit the 3rd textbox on...
1
by: vvenk | last post by:
Hello: I have a windows form that has a command button. I was trying to set focus on it in the form's Load event. It did not work. However, moving the line of code to the form's activate event,...
5
by: Tosch | last post by:
I have a usercontrol with a label, a textbox, a treeview, a grid and a couple of checkboxes. The usercontrol is hosted on a form together with a cancel and a accept button. This form is used to...
9
by: Zytan | last post by:
http://msdn2.microsoft.com/en-us/system.windows.forms.control.focus(VS.80).aspx this page says: "Focus is a low-level method intended primarily for custom control authors. Instead, application...
4
by: Roger | last post by:
Hi, I am confused about the differences between this.window.focus(), window.focus(), and this.focus(). I want to use the calls in a <body onload="..."tag. What are the differences between...
1
by: ton | last post by:
Hi, I'm using Ajax to seach direct in a gridview. It works fine. I even keep the focus on the input text box. Here is my code: Protected Sub Page_Load(ByVal sender As Object, ByVal e As...
8
by: Mel | last post by:
I have several text boxes and drop-down lists in an AJAX Update Panel. All user inputs have the Postback property set to True. After I type something in the first input entry and press the "Tab"...
11
by: slinky | last post by:
I'm trying to simply set the focus of "txtUserName" upon opening this login form. I put in some Javascript but it is not working. Any ideas? Thanks! <%@ Page Language="vb"...
3
by: Christian Blackburn | last post by:
Hi Gang, I have two text boxes on a form and if the first text box is populated, I want to place focus on the second text box at startup. However, this never seems to work. What am I doing...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.