Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- **if (document.forms.length > 0) {**
- // Ensure we get the 'real' form
- for (var j=0; j<document.forms.length; j++)
- {
- if (document.forms[j].action != 'undefined' && document.forms[j].action != '')
- {
- frm = document.forms[j];
- break;
- }
- }
- // Find the first usable input field and set focus
- if (frm.elements.length > 0)
- {
- for (var i=0; i < frm.elements.length; i++)
- {
- elm = frm.elements[i];
- if ( canHaveFocus(elm) )
- {
- elm.focus();
- return;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement