so here is my problem. first off i am using cold fusion. I have select boxes dynamically named depending on how many there should be. I also have a default value in both select boxes. if the user wants to change a value in one of the boxes(which is populated from the db), the 2nd select box will be populated with a new value(grabbed from the db based on the selection from the 1st select box). the real problem is i cannot get the .option[ind] to recognize the 'ind'. it seems since it is a dynamically named select box that the name and the " symbols are messing it up. the following is the code i am using so far:

<script>
<cfoutput>
function h_part_change(){
var p = #get_SCR_lines.scr_line_nbr#; //this is the value used as a looping value
var hgear = eval("document.forms[0].hgears1"+"_"+p+".value");
//following is the query used to create the arrays for the two select boxes
<cfquery name="hgear_part_desig_qn1" datasource="#session.dbase#" username="#session.uname#" password="#session.pword#">
select a.part_number part_nbr, a.hgear_desg hgear_desg
from tlos_specs a, stk_hgear_weapon_specs b
<cf_hgear_where>
order by part_number
</cfquery>
//two arrays for each select box
var h_pn = new Array(#quotedValueList(hgear_part_desig_qn1.part_nbr)#);
var h_desg = new Array(#quotedValueList(hgear_part_desig_qn1.hgear_desg)#);

for(i=0; i<h_desg.length; i++){
if (h_desg[i] == hgear){
//alert(h_pn[i] + ' is the part number now being filled into the Associate with Part No. field');
for (ind = 0; ind<3; ind++)
{
var option_text = "document.forms[0].assoc_part_nbr1_"+p+".options[ind].text";
//alert(option_text);
if (eval(option_text) == h_pn[i] )
{
alert(ind);
var option_sel = "document.forms[0].assoc_part_nbr1_"+p+".options[ind]";
alert(option_sel);
}
}
}
}
}


//first select box:
<cfoutput><select name="hgears1_#get_SCR_lines.scr_line_nbr#" onChange="return h_part_change();"></cfoutput>
<option value="">--</OPTION>
<cfoutput query="hgear_part_desig_qn1">
<cfset hgear = "#hgear_part_desig_qn1.hgear_desg#">
<option value="#hgear#" <cfif #hgear# IS #get_assocs1.HGEAR_DESG#>selected</cfif>>
#hgear#</OPTION>
</cfoutput>
</select>

//second select box:
<cfoutput><select name="assoc_part_nbr1_#get_SCR_lines.scr_line_nbr#"></cfoutput>
<cfoutput query="hgear_part_desig_qn1">
<cfset hgear = "#hgear_part_desig_qn1.h_part_no#">
<option value="#hgear#" <cfif #hgear# IS #get_assocs1.ASSOC_PART_NBR#>selected</cfif>>
#hgear#</OPTION>
</cfoutput>
</select>

thanks for any help
dan