How do you set focus on a specific field?
I'm trying to set focus on the initial form field when the User enters the page. I'd also like to know, in case of an error, how to set focus on the error field.
Can anyone help?
Thanks so very much! I've had open heart surgery and one of the side effects of the heart/lung machine is that parts of memory disappear - forever. This was one of those items. I really appreciate your help!!!
Am assuming, in case of error, that one would canabalize the ONLOAD code and use the apppropriate index, right?
Yes indeed... the code I used was "the first element of the first form on the page." You can change them to reflect your element, or assign it an ID and access it with document.getElementById('id').
The forms and elements collections work just as well with id attributes as they do with indices and name attributes, and are better supported than the getElementById method.
Originally Posted by Twey
So, better to use the former than the latter. However, if you add a new form or element before the initial element, you will need to adjust the indices.
Talk to any cardiologist and they'll tell you the same thing: open heart surgery using a heart/lung machine selectively destroys parts of memory. Forever. No one knows why.
Perhaps I'm just tired right now but I think an apology would not be out of place here. If I knew to whom this kind of thing should be reported, that would be my next step. It must be very nice to live in your particular world.
I'm sorry, it wasn't intended to be insulting. Perhaps "memory" is a better word than "knowledge" in the circumstance. If you feel it should be reported, ddadmin is the one to go to.
I think this is just a misunderstanding. From how I saw it, Twey was being playful when he made that comment, with no intent to insult at all. Adding a smilie face at the end usually is a sign of that.
OK, then. Over and done with, I guess.