fatglasses
08-13-2003, 01:20 PM
Hi all. This is my first time in here! I have a question. When a page loads up I want the focus to initially be set on a dropdown list. Right now it is set on a text box. Here is what the (javascript/html) code looks like:
function SetFocus()
{for (i=0; i<NumElements; i++)
if (document.LANSA.elements[i].type == "textarea" ||
document.LANSA.elements[i].type == "text" ||
document.LANSA.elements[i].type == "checkbox" ||
document.LANSA.elements[i].type == "radio")
{document.LANSA.elements[i].focus();
break;}
}
So how would I have a dropdown list (selection list) be part of those options, (since selection lists do not have a "type" property). Clear as mud? Thanks in advance!
function SetFocus()
{for (i=0; i<NumElements; i++)
if (document.LANSA.elements[i].type == "textarea" ||
document.LANSA.elements[i].type == "text" ||
document.LANSA.elements[i].type == "checkbox" ||
document.LANSA.elements[i].type == "radio")
{document.LANSA.elements[i].focus();
break;}
}
So how would I have a dropdown list (selection list) be part of those options, (since selection lists do not have a "type" property). Clear as mud? Thanks in advance!