Immediate Goal: Getting a text input field to focus if it is empty (cross browser compatible)
Future Goal: Specifically I have a login and password form of which I want the function to check the email field first and if populated I want it to focus on the password field
Problem: No matter what fucntion I try I can't seem to get any fields to focus in Firefox. I currently have Firefox 3.6.13 running.
What has been tried: The page I'm working on uses an exernal .js file so typically I throw all my coding in there. For the purpose of this example let's say my form is structured like this:
and in my .js file I have the following:
and of course my opening body tag would have:
I'm probably confused with syntax or even the document model (or possibly something very complex that I'm not even seeing). It wouldn't surprise me. I do a lot of ASP coding so I often mix up the two languages at times. Now the example above was thrown together just to see if I can get the field to focus on page load. I'm not asking for a script to do what I described in the detailed description. I can probably figure that out myself. In scaling back what I was doing I figured I'd try just focusing a specified field on page load but it doesn't work in FF(x) or IE(x). My mind is just exhausted from trying to hammer out the logic. If someone would be so kind as to help an old man out it'd be greatly appreciated. I can often run with things once I understand why they do or don't work. I'm just brain fried at the moment.