Advertisement

04.27.2004 at 06:35PM PDT, ID: 20969987
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.8

debug please

Asked by CookieMonster9999 in JavaScript

Tags:

I am trying to create a form with a drop down menu where once an item is selected the values in another drop down menu are changed based on the value of the first menu.  Not all of the menu items have further sub-categories so the value is null for now.

I am getting the error:
'team' is undefined

Please note I was trying to use the source code from here:
http://javascript.internet.com/forms/auto-drop-down.html

Please can somebody find the error in my script! Thanks in advance!

Here is the script:


<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
team = new Array(
null,
null,
null,
null,
null,
null,
null,
new Array(
new Array("Old School Rap", 1),
new Array("Rap Metal", 2),
new Array("Gangsta Rap", 3),
new Array("Southern Rap", 4),
new Array("Dirty South", 5)
),
null,
null,
null,
null,
null,
null,
);
 
function fillSelectFromArray(selectCtrl, itemArray, goodPrompt, badPrompt, defaultItem) {
var i, j;
var prompt;
// empty existing items
for (i = selectCtrl.options.length; i >= 0; i--) {
selectCtrl.options[i] = null;
}
prompt = (itemArray != null) ? goodPrompt : badPrompt;
if (prompt == null) {
j = 0;
}
else {
selectCtrl.options[0] = new Option(prompt);
j = 1;
}
if (itemArray != null) {
// add new items
for (i = 0; i < itemArray.length; i++) {
selectCtrl.options[j] = new Option(itemArray[i][0]);
if (itemArray[i][1] != null) {
selectCtrl.options[j].value = itemArray[i][1];
}
j++;
}
// select first item (prompt) for sub list
selectCtrl.options[0].selected = true;
   }
}
//  End -->
</script>



and the form:

<form method="POST" name="main" action="">
<SELECT NAME="Make" onChange="fillSelectFromArray(this.form.Team, ((this.selectedIndex == -1) ? null : team[this.selectedIndex-1]));">
<option value="-1">-</option>

<option value="1">Alternative</option>

<option value="2">Blues</option>

<option value="3">Classical</option>

<option value="4">Country</option>

<option value="5">Jazz</option>

<option value="6">Metal</option>

<option value="7">New Age</option>

<option value="8">Rap</option>

<option value="9">R&B</option>

<option value="10">Rock</option>

<option value="11">Electronica</option>

<option value="12">Pop</option>

<option value="13">Soul</option>

<option value="14">Christian</option>

</select>

<SELECT NAME="Team" SIZE="5">
<OPTION>&nbsp;</OPTION>
<OPTION>&nbsp;</OPTION>
<OPTION>&nbsp;</OPTION>
<OPTION>&nbsp;</OPTION>
<OPTION>&nbsp;</OPTION>
</SELECT>

</form>Start Free Trial
 
Loading Advertisement...
 
[+][-]04.27.2004 at 07:23PM PDT, ID: 10934834

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.27.2004 at 07:39PM PDT, ID: 10934910

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.27.2004 at 07:44PM PDT, ID: 10934948

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.27.2004 at 07:48PM PDT, ID: 10934970

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.27.2004 at 07:49PM PDT, ID: 10934977

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: JavaScript
Tags: fillselectfromarray
Sign Up Now!
Solution Provided By: ho_alan
Participating Experts: 1
Solution Grade: A
 
 
[+][-]04.27.2004 at 07:50PM PDT, ID: 10934981

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.27.2004 at 07:52PM PDT, ID: 10934998

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.27.2004 at 08:01PM PDT, ID: 10935052

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.27.2004 at 08:03PM PDT, ID: 10935060

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.27.2004 at 08:05PM PDT, ID: 10935066

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.27.2004 at 08:17PM PDT, ID: 10935124

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.27.2004 at 08:23PM PDT, ID: 10935152

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32