Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

selectedindex is coming up undefined

Status
Not open for further replies.

faisalsham

Programmer
Mar 11, 2005
18
0
0
US
I have the following function that I'm using to build a query string. however the selectedindex for the listbox is coming out to be 'undefined' not sure what's wrong with the code. please help!

Code:
function BuildQueryString(frmin)
{
  var contractPK;
  var qs;
  var i;
		
  contractPK = frmin.txtContractPK.value;
  i= frmin.lstContracts.selectedindex;
  qs= "Sales.asp?code=" + contractPK + "&index=" + i; 
  document.location=qs
}

when i use alert(i) to see the value of i, i get undefined in the dialogbox.

thanks
 
Try selectedIndex (with a capital I).

--Dave
 
Javascript is case sensitive
Code:
i= frmin.lstContracts.selected[b][COLOR=red]I[/color][/b]ndex;

-kaht

...looks like you don't have a job, so why don't you get out there and feed Tina.
headbang.gif
[rockband]
headbang.gif
 
thanks for the help... that worked.. i need a vacation!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top