On Thu, 22 Jan 2004 13:24:33 +0100, Stanislas <sr******@intertek.fr> wrote:
and don't know how to do.
In future, please actually include the question in the body of your post,
even if it's just a copy of the subject[1].
<snip> objSelect = top.document.getElementById(strIdSelect);
objSelet ???
When you say list, I assume you mean a SELECT element.
If your list is in a form, like this:
<form ... name="formName">
<select ... name="listName">
...
you can reference the list with JavaScript like so:
document.formName.listName
To select the first item in the list, you can write:
document.formName.listName.selectedIndex = 0;
If your list is not part of a form, you'll need to place an ID on it, like
this:
<select ... id="listId">
and access it thus (I included feature detection):
var listObject = null;
if( document.getElementById ) {
listObject = document.getElementById( 'listId' );
} else if( document.all ) {
listObject = document.all[ 'listId' ];
}
if( listObject ) {
listObject.selectedIndex = 0;
}
Hope that helps,
Mike
[1] Bad clients might not show the entire subject, making it impossible
for people to understand your question help you.
--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)