Welcome to WebmasterWorld Guest from 54.159.190.106

Forum Moderators: open

Message Too Old, No Replies

Javascript focus question

   
7:16 pm on May 20, 2003 (gmt 0)

10+ Year Member



How can I check if a field is 'allowed' to accept focus?

disabled , hidden, or invisible fields can't...Is there an easy way to check?

7:20 pm on May 20, 2003 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



for disabled

if (document.formname.element.disabled == true)

you can change the values of hidden or invisible elements in the script but I don't quite understand why you would need to test for that.

gph

8:33 pm on May 20, 2003 (gmt 0)

10+ Year Member



The lazy route :)

try {
document.getElementById('hidden-field').focus()
} catch(e) {
alert("can't focus because of\n\n" + e)
}

 

Featured Threads

Hot Threads This Week

Hot Threads This Month