"Undefined" in scrolling_list
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

"Undefined" in scrolling_list

From: William <wh2leung@student.cs.uwaterloo.ca>
Date: Fri Jan 20 2006 - 20:51:53 CET

I tried to update a scrolling_list with the following:

function saveText( scroll_list, t_area, listToBeUpdated ) {
     var updated = new Option();
     updated.value = t_area.value;
     updated.text = t_area.text;
     scroll_list.options[scroll_list.selectedIndex] = updated;
}

but I get "Undefined" in the position with the new Option()
(i.e. "updated").

Why and how to fix this?
Received on Tue Feb 7 21:16:31 2006