lazzerous
11-13-2003, 01:17 PM
I have a js function call within an html select box
The function is supposed to populate part of an array with the selected value, and then populate a text box with all of the elements of the array..
I am receiving the error 'object expected' on the line the select box is on.
Any ideas? The related pieces of code are below...
<script language="javaScript">
<!--
var finalpart;
function updatePart(specnum)
{
alert('um...');
var val = document.aform.pb_option[specnum].options[selectedIndex].value;
finalpart[specnum] = val;
var toshow = "";
alert(finalpart.length);
var l;
for (l = 0; l < finalpart.length; l++)
{
toshow .= finalpart[l];
}
alert(toshow);
document.aform.showpart.value = toshow;
}
-->
</script>
<select name="pb_option[4]" onChange="updatePart('4')">
<option value='P'>P - Pin (Plug)
<option value='2'>2 - Socket (Receptacle)
</select>
Thanks in advance for your assistance.
-=Lazzerous=-
The function is supposed to populate part of an array with the selected value, and then populate a text box with all of the elements of the array..
I am receiving the error 'object expected' on the line the select box is on.
Any ideas? The related pieces of code are below...
<script language="javaScript">
<!--
var finalpart;
function updatePart(specnum)
{
alert('um...');
var val = document.aform.pb_option[specnum].options[selectedIndex].value;
finalpart[specnum] = val;
var toshow = "";
alert(finalpart.length);
var l;
for (l = 0; l < finalpart.length; l++)
{
toshow .= finalpart[l];
}
alert(toshow);
document.aform.showpart.value = toshow;
}
-->
</script>
<select name="pb_option[4]" onChange="updatePart('4')">
<option value='P'>P - Pin (Plug)
<option value='2'>2 - Socket (Receptacle)
</select>
Thanks in advance for your assistance.
-=Lazzerous=-