Could someone please help me convert the cold fusion code to JSP inside this javascript function???
I've been trying for all day and can't get it right.
<script language="JavaScript">
// Pre-populate the Exchange and Route select boxes.
function getExchangeRoutes(obj){
switch (obj.ExchangeId.selectedIndex){
<CFOUTPUT query="qExchangeAndRoutes" group="Exchange">
<CFSET mycase = mycase + 1>
case #mycase#:
<CFSET myList = ValueList(qExchangeAndRoutes.ExchangeId)>
<CFSET numberInExchange = ListValueCount(myList, ExchangeId)>
obj.RouteId.length=#numberInExchange#;
<CFOUTPUT>Rec Count: #qExchangeAndRoutes.RecordCount# - numberInExchange: #numberInExchange#</CFOUTPUT>
<CFOUTPUT>
<CFSET idx = idx + 1>
obj.RouteId.options[#idx#].value="#TRIM(qExchangeAndRoutes.RouteId)#";
obj.RouteId.options[#idx#].text=formatRoute('#qExchangeAndRoutes.RouteName#');
</CFOUTPUT>
break;
<CFSET idx = -1>
</CFOUTPUT>
}
}
</script>
Thanks,
Dave
I've been trying for all day and can't get it right.
<script language="JavaScript">
// Pre-populate the Exchange and Route select boxes.
function getExchangeRoutes(obj){
switch (obj.ExchangeId.selectedIndex){
<CFOUTPUT query="qExchangeAndRoutes" group="Exchange">
<CFSET mycase = mycase + 1>
case #mycase#:
<CFSET myList = ValueList(qExchangeAndRoutes.ExchangeId)>
<CFSET numberInExchange = ListValueCount(myList, ExchangeId)>
obj.RouteId.length=#numberInExchange#;
<CFOUTPUT>Rec Count: #qExchangeAndRoutes.RecordCount# - numberInExchange: #numberInExchange#</CFOUTPUT>
<CFOUTPUT>
<CFSET idx = idx + 1>
obj.RouteId.options[#idx#].value="#TRIM(qExchangeAndRoutes.RouteId)#";
obj.RouteId.options[#idx#].text=formatRoute('#qExchangeAndRoutes.RouteName#');
</CFOUTPUT>
break;
<CFSET idx = -1>
</CFOUTPUT>
}
}
</script>
Thanks,
Dave