[SOLVED] Text From Drop down box

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
Bain
Forum Newbie
Posts: 5
Joined: Mon Sep 06, 2004 4:32 pm

[SOLVED] Text From Drop down box

Post 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?
Last edited by Bain on Wed Sep 15, 2004 2:45 pm, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

selectedIndex

notice the case difference..
Bain
Forum Newbie
Posts: 5
Joined: Mon Sep 06, 2004 4:32 pm

Post by Bain »

Thanks, I forgot javascript is case sensitive. sorry to bother you with such a noober question.

thanks again
Post Reply