Listbox code not working

L

level300

Hello all.

I am running into a problem with the code below. The error it returns
is

"sel.options is not a function". NN7.1

fucntion setproject(xsel)
{
var sel=xsel.lstProjects;
var projectname=sel.options[sel.selectedIndex].text;
var target=opener.targetfield;
var strtarget='S'+target
var strtarget2='hyper'+target
opener.document.forms[0].elements[strtarget].value=sel.value;
opener.document.forms[0].all[strtarget2].replaceAdjacentText('afterBegin',projectname.substring(8,projectname.length));
}

Thanks in advance.

Rick
 
M

Mick White

level300 said:
Hello all.

I am running into a problem with the code below. The error it returns
is

"sel.options is not a function". NN7.1

fucntion setproject(xsel)
{
var sel=xsel.lstProjects;

var sel=xsel["lstProjects"];// token syntax forbids a number at the
start of the variable
var projectname=sel.options[sel.selectedIndex].text;
var target=opener.targetfield;
var strtarget='S'+target
var strtarget2='hyper'+target
opener.document.forms[0].elements[strtarget].value=sel.value;
opener.document.forms[0].all[strtarget2].replaceAdjacentText('afterBegin',projectname.substring(8,projectname.length));
opener.document.forms[0].all ... this is IE Windows only

Mick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top