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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

assign select list text to Varable

Status
Not open for further replies.

seanybravo

IS-IT--Management
Sep 24, 2003
89
GB
Why cant I assign my list text to the strCat Varable? I keep getting "frm.elements.SelectedCategories.options has no properties" error

Code:
function customTotals(){
	//alert("Custom Totals HE HE")
	
	frm = document.forms['CustomerDetails']
	var numberCat = frm.elements['SelectedCategories'].length
	var strCat = ""
	
	if (numberCat >0){
		//alert(frm.elements['SelectedCategories'].options[0].text)
		for(i=0; i<=numberCat; i++){
			//alert(frm.elements['SelectedCategories'].options[i].text)
			strCat = (frm.elements['SelectedCategories'].options[i].text)
		}
		
		alert(strCat)
	}	
	
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top