I just wanted to thank you for taking the time to get with me on this. The tech support you guys provide on this forum is outstanding.
Anyway, after doing some research based on what you gave me as a starting point I came up with the following code that works for me.
The following javascript function "setFocus()" will set the focus and select the text in the first form element on a page if the page has at least one form and that form has at least one element.
<script type="text/javascript">
function setFocus()
{
if( (document.forms.length > 0) && (document.forms[0].elements.length > 0) )
{
document.forms[0].elements[0].select();
document.forms[0].elements[0].focus();
}
}
</script>
Then it's just a matter of putting the function in your base template and calling it from the onload portion of the body tag as you have already stated.
<body onload = "setFocus();">
Easy squeezy! Now every page that has an input form based on that template will set the focus to the first input box on the page. No more code more needed.
Thanks again for all your help. You guys rock!
- Mikel
...