home
design & development
Lotus application development
print design
web site development
request a design quote
solutions & consulting
Notes and Domino application development
Lotus Domino administration
Securence Mail Filtering
UNITRENDS backup and recovery
Lotus Notes / Domino Apps
free Lotus Notes apps
hosting
web site hosting
Lotus application hosting
check your mail
request a hosting quote
publishing
media and publishing
sound
client services
help & support
Make Payment
Client Access - Workboard
billing & payment policies
copyright & liability policies
pricing & turnaround policies
privacy statement
contact
e-mail MW
get files
send files
Cannot Focus on Radio Button w/JavaScript focus() Method
Mindwatering Incorporated
Author: Tripp W Black
Created: 10/10/2011 at 04:15 PM
Category:
Notes Developer Tips
JavaScript
Issue:
With the following code snippet, the field.focus() method doesn't work. The browser responds that the object doesn't support (have) this method.
f=document._MyForm;
if (f.Q2 !=null) {
f.Q2.focus();
}
Solution:
The solution is to remember that RadioButtons are an array and you have to focus on a specific element within the array to focus. To fix this is actually very simple:
f=document._MyForm;
if (f.Q2 !=null) {
f.Q2[0].focus();
}
Note:
IE seems to give you NO visual clue (As of IE 6 and IE 7) that your focus worked unless the page is long enough to make it scroll. The other good browsers such as Firefox, Safari, and Chrome all block/square the field to let you know that it has focus.
previous page
×