Obviously getElementsByName() returns a collection so you
would need to do something like this
document.getElementsByName('ddlMonEnd')
[0].options.selectedIndex to get the select object...
(i'm not really sure this kind of syntax is correct in
javascript, it is in C#.. if it doesnt work put the
collection in a variable and then index into it)
anyway, it is easier to access an object with
getElementById as it only returns one object, not
collection...
im not sure about netscape, but in IE to access an object
you can just use its ID like if you object has the id
ddlMonEnd just alert(ddlMonEnd.options.selectedIndex)...
you can also do alert
(document.formname.ddlMonEnd.options.selectedIndex )..
there are many ways to access it and you picked a pretty
wierd one :) maybe you have your reasons though
-----Original Message-----
Hi all,
Can anyone see what is wrong with this function. It's
being called by the OnClick of a radio button. For some
reason I can't access the options collection or any of
theSelect's basic properties (e.g. type, name etc.). I've
tried access ddlMonEnd using this syntax as well as
GetElementByID and doc.frm.ddlMonEnd. None of them work
for me.
function SetWeekdayServiceTimes
(intStartIndex,intEndIndex){
alert
(document.getElementsByName('ddlMonEnd').options.selectedIndex);
}
.