www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Server-Side Development > Other

    Other Discussion and technical support for any other scripting methods.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1  
    Old 11-22-2004, 11:54 AM
    Frosty1_4me Frosty1_4me is offline
    Registered User
     
    Join Date: Nov 2004
    Posts: 5
    Converting Coldfusion to Javascript.

    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>
    Reply With Quote
      #2  
    Old 12-02-2004, 08:34 PM
    PeOfEo's Avatar
    PeOfEo PeOfEo is offline
    Data Center Troll
     
    Join Date: Nov 2002
    Location: Auburn, AL
    Posts: 10,037
    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.
    Reply With Quote
      #3  
    Old 12-03-2004, 10:40 AM
    Frosty1_4me Frosty1_4me is offline
    Registered User
     
    Join Date: Nov 2004
    Posts: 5
    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.
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 09:21 PM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.