•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 430,100 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,183 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 1629 | Replies: 1
![]() |
•
•
Join Date: Feb 2008
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
Hello all,
I have a few '<input type="text" />' controls on my ASP.NET 2.0 generated page.
Every text-box control has it's specific tab-index.
When I try to move focus to this specific text-box control on this page the focus is shifted to the window element instead of the control itself.
On every other text-box control on the page the focus is received fine.
To apply focus to this element I use the code:
This is the control itself:
Some other text-box control on the page:
I have a few '<input type="text" />' controls on my ASP.NET 2.0 generated page.
Every text-box control has it's specific tab-index.
When I try to move focus to this specific text-box control on this page the focus is shifted to the window element instead of the control itself.
On every other text-box control on the page the focus is received fine.
To apply focus to this element I use the code:
document.all.elemName.focus();
This is the control itself:
<input name = "ctl00$EditMasterContent$c_carats"
type = "text"
maxlength = "10"
id = "ctl00_EditMasterContent_c_carats"
tabindex = "6"
class = "textbox1"
onchange = "registerOnChangeAction("caratsChanged");"
onkeypress = "javascript:ChkNumberKeyPress(false);"
onfocus = "initFocusedElementsVar(this.id);"
style = "width: 100px;" />Some other text-box control on the page:
<input name = "ctl00$EditMasterContent$c_stones"
type = "text"
maxlength = "5"
id = "ctl00_EditMasterContent_c_stones"
tabindex = "5"
class = "textbox1"
onchange = "registerOnChangeAction("stonesChanged");"
onkeypress = "javascript:ChkNumberKeyPress(false);"
onfocus = "initFocusedElementsVar(this.id);"
style = "width: 100px;" /> Last edited by orico : Feb 4th, 2008 at 1:14 am. Reason: typing mistake
Try
document.forms[0].elements['yourElementName'].focus(). Don't use document.all. It's not a standard property of the document object. And having a 1.8K line source file is bad in itself IMO. I don't accept change. I don't deserve to live.
Happiness corrupts people.
Failing to value the lives of others cheapens your own.
Happiness corrupts people.
Failing to value the lives of others cheapens your own.
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
ajax asp cross-browser javascript menu with few lines of code developer development firefox home html internet javascript javascript smooth scrolling scroll smoothly window document position javascript tab menu with rounded corners generator microsoft msdn office prevent javascript menu from getting hidden under flash movies site software sql vista web
- ALL GMail invites to be posted here please! (Geeks' Lounge)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Position and Load an image when Clicked
- Next Thread: Array Names



Linear Mode