File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes onChange in select menu,  problems with Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "onChange in select menu,  problems with" Watch "onChange in select menu,  problems with" New topic

onChange in select menu, problems with

Justin Beattie

Joined: Nov 28, 2001
Posts: 9
Hey, thanks in advance for respoding. This is a javascript question about the onChange event handler. I'm trying to dynamically modify a table based on what elements are selected in drop downs. Here's code for one of them:
<select name="cpu" onChange="updateList(0);">
<option selected>-- - - - --Select CPU-- - - - --</option>
<option value="AMD DURON 800&49.99"> AMD Duron 800 </option>
<option value="AMD DURON 850&59.99"> AMD Duron 850 </option>
< !--....and so on, and so on....-->

Now, i have several of these. Here's the updateList function:
function updateList(ntype)
var selected;
< !-- ntype is dependant on which drop down menu is selected. Each drop down contains various computer components grouped together -->
strings = svalue.split("&");
sname = strings[0];
fcost = parseInt(strings[1]);
list.firstChild.ChildNodes[0].firstchild.firstchild.nodevalue="AMD DURON 800";


As far as i know, the problem is not with the function but in the function call. I am using MSIE 6.0 and whenever i select "AMD DURON 800" from the select box, i get an error message at the function call line saying "object expected" (error code 0). Any suggestion? Thanks.....
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
You posted this in the Java in General forum, I'm moving it to the HTML/Javascript froum where you'll probably get a better response.

I agree. Here's the link:
subject: onChange in select menu, problems with
jQuery in Action, 3rd edition