Change the focus to table row

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Jan 2008
Posts: 35
Reputation: anish.anick is an unknown quantity at this point 
Solved Threads: 3
anish.anick anish.anick is offline Offline
Light Poster

Change the focus to table row

 
0
  #1
Sep 25th, 2008
Hi All,
Is there any way to set the focus to a table row using javascript so that subsequent key press events can iterate through the table rows.Please help me to solve this.

Thanks
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 849
Reputation: R0bb0b is on a distinguished road 
Solved Threads: 67
R0bb0b's Avatar
R0bb0b R0bb0b is offline Offline
Practically a Posting Shark

Re: Change the focus to table row

 
0
  #2
Sep 27th, 2008
Originally Posted by anish.anick View Post
Hi All,
Is there any way to set the focus to a table row using javascript so that subsequent key press events can iterate through the table rows.Please help me to solve this.

Thanks
Only things that can accept focus can receive focus, which would be form objects like text boxes, radio buttons etc... and hyperlinks. You should be able to do it with the focus() function.
“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” - Dr. Seuss

-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 213
Reputation: nikesh.yadav is an unknown quantity at this point 
Solved Threads: 17
nikesh.yadav's Avatar
nikesh.yadav nikesh.yadav is offline Offline
Posting Whiz in Training

Re: Change the focus to table row

 
0
  #3
Sep 29th, 2008
for IE and FF You can set focus to object and embed respectively.but i m not sure about other browser
Help as an alias

I think programming is great................
Tour Travel weblink by me and about Tour ,
Go To My Home Page and I m in Webdevelopment.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 348
Reputation: Troy III will become famous soon enough Troy III will become famous soon enough 
Solved Threads: 42
Troy III's Avatar
Troy III Troy III is offline Offline
Posting Whiz

Re: Change the focus to table row

 
0
  #4
Sep 29th, 2008
Originally Posted by anish.anick View Post
Hi All,
Is there any way to set the focus to a table row using javascript so that subsequent key press events can iterate through the table rows.Please help me to solve this.

Thanks

As nikesh.yadav already pointed, there are only two true conventional browsers that will handle focus as expected for elements other anchors and forms for certain. That is, IE and FX.

You can write a loop function that iterates through table elements that should receive focus and use a declaration like:

tag[i].tabIndex = "auto";
to make them receive focus. This additionally prevents you from breaking the tab order on your document.

It will enable your client to tab through your table rows, cells and/or other desired elements the conventional way, (or browser specific), without having to explain that there are keys with added functionality and how to use them.

Regards.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC