I have a site that used to use Coldfusion, and I would like to remove the CFOUTPUT tags code from the javascript. I would really like it converted to .net, but I've never seen a dropdown list populated dynamically from a file and not a database before.
So I'll settle with the removal of the CF tags from the javascript. Could someone please help??
<SCRIPT LANGUAGE="JavaScript">
<!--- Populates the dropdown list for the symbols to be selected --->
function getSymbols()
{
var map = getMainMap();
var theSymColl = map.getSymbols();
var opt = new Option("-- Select a symbol --", "null");
eval("document.draw_form.draw_symbol_name.options[0]=opt");
for (var i=0; i < theSymColl.size(); i++){
var opt = new Option(theSymColl.item(i), theSymColl.item(i));
eval("document.draw_form.draw_symbol_name.options[i+1]=opt");
<CFIF ISDEFINED("DRAW_SYMBOL_NAME")>
<CFOUTPUT>
var selectedSym = "#DRAW_SYMBOL_NAME#";
</CFOUTPUT>
if (theSymColl.item(i) == selectedSym){
document.draw_form.draw_symbol_name.options[i+1].selected=true;
}
</CFIF>
}
}
</script>
To populate a drop down list from a db in .,net is very easy. You just need a data set and you are set. You can do it with the asp.net elements or just a loop and a standard html drop down list. Either way it is very easy to do. I could furnish code if you like.
That's what I was trying to avoid was using a db and ds because then I have to maintain it. The way it currently works is that it extracts the list and symbols from an API. I've since decided to convert it all to asp.net and use a database. It's not idea but it gives me so many more options. I was able to get the functionality as well as add in new validation controls which is unavailable with javascript and html.
So it's done now, but thanks for the options, it's much appreciated.
Bookmarks