This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

onChange in select menu, problems with

Justin Beattie
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic