homepage Welcome to WebmasterWorld Guest from 54.196.136.119
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Javascript focus question
dididaman




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

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?

 

jatar_k




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

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




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

The lazy route :)

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved