Page 1 of 1

[SOLVED] Text From Drop down box

Posted: Wed Sep 15, 2004 2:32 pm
by Bain

Code: Select all

function writeReportTitle()
{
var x = document.form0.status.selectedindex;
var stroutput = document.form0.status.optionsїx].text + " Sales Overview " + document.form0.fstart_date.value + " through " + document.form0.fend_date.value;
document.write(stroutput);
}
it keeps saying that document.form0.status.options[x].text is null or not an object.

the spelling of status is the same. I can get form0.status.value just fine, but when I try to get the selectedindex it says the object is null.

any ideas?

Posted: Wed Sep 15, 2004 2:37 pm
by feyd
selectedIndex

notice the case difference..

Posted: Wed Sep 15, 2004 2:45 pm
by Bain
Thanks, I forgot javascript is case sensitive. sorry to bother you with such a noober question.

thanks again