Assuming they have the same name:

function getData(form) { 
   for(var i=0;i<form.UsageCsaId.length;i++){
     form.OriginalCompanyCode[i].value =
originalCompany[form.UsageCsaId[i].selectedIndex];
   }
}

If they have different names, just repeat the code in your function 10
times with the appropriate names

Pascal


> -----Original Message-----
> From: Issac Rosa [mailto:[EMAIL PROTECTED]
> Sent: 22 November 2004 23:02
> To: CF-Talk
> Subject: OT: Javascript Problem
> 
> Sorry for the OT, but thought someone on here might have a quick
> solution.  I need to change this form to have 10 input rows.  How
would
> I modify the JS below to handle the 10 rows of selects and linked text
> input?
> 
> 
> 
> <HTML>
> 
> <HEAD>
> 
> <TITLE>Parallel Array Lookup</TITLE>
> 
> <SCRIPT LANGUAGE="JavaScript">
> 
> // the data
> 
> var UsageCsaId = new Array("ABERDEEN","AGOURA","AGUADILLA","AKRON");
> 
> var originalCompany = new Array("6410","8728","1260","6613");
> 
> // do the lookup into parallel arrays
> 
> function getData(form) {
> 
>    var i = form.UsageCsaId.selectedIndex
> 
>    form.OriginalCompanyCode.value = originalCompany[i]
> 
> }
> 
> </SCRIPT>
> 
> </HEAD>
> 
> 
> 
> <BODY onLoad="getData(document.frmMaintenance)">
> 
> <H1>Parallel Array Lookup</H1>
> 
> <HR>
> 
> <FORM NAME="frmMaintenance">
> 
> <SELECT NAME="UsageCsaId" onChange="getData(this.form)">
> 
>    <OPTION>ABERDEEN
> 
>    <OPTION>AGOURA
> 
>    <OPTION>AGUADILLA
> 
>    <OPTION>AKRON
> 
> 
> 
> </SELECT>
> 
> <INPUT TYPE="text" NAME="OriginalCompanyCode" SIZE=4 readonly>
> 
> </BODY>
> 
> </HTML>
> 
> 
> 
> Thanks,
> 
> Issac
> 
> 
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:185109
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to