ColdFusion Muse

Running Queries Using JavaScript?

Mark Kruger March 10, 2006 2:45 PM Coldfusion Tips and Techniques Comments (6)

CF Muse Reader Asks:
I am trying to develop 3 drop down list boxes which gets the data from the database. On change of first will pop up second and on change of second will get the values based on first and second. Do you know the smartest way to do this. How can I run queries from JavaScript?

The first thing to decide is, do you really want to connect to the server for each change in the drop down box? The answer depends on the size and schema of the database.

Read More
  • Share:

6 Comments

  • Barry's Gravatar
    Posted By
    Barry | 3/10/06 2:15 PM
    Can you embed the flash remoting into cfforms? Or rather, is there a technique to accomplish this same task when using flash cfforms?

    (excuse my ignorance if this is a basic functionality of them, I haven't had a chance to dig into the latest forms yet)
  • mkruger's Gravatar
    Posted By
    mkruger | 3/10/06 2:28 PM
    Alas no you cannnot. One of my pet peeves with flash forms is that you cannot really do anything "flash-like" with them. In my humble opinion flash forms is really a "loss-leader" or a "sales teaser" to try to point you toward Flex (a very nice yet vastly overpriced product). See my post on the flash form limitations for more information.

    http://mkruger.cfwebtools.com/index.cfm?mode=alias...
  • Christopher Wigginton's Gravatar
    Posted By
    Christopher Wigginton | 3/10/06 3:18 PM
    Another solution is Matt Kruse's Dependent Select Boxes which can be found on his JavaScript toolbox site.
    http://www.javascripttoolbox.com/lib/dynamicoption...
  • mkruger's Gravatar
    Posted By
    mkruger | 3/10/06 3:29 PM
    Chris, while I like this solution, it is purely client side. It would fit in the same category as option 1 above - useful to a point, but not terribly scalable.
  • PaulH's Gravatar
    Posted By
    PaulH | 3/10/06 10:07 PM
    i beg to differ. you can do a ton of "flash-like" functionality with flashforms and the required AS is usually pretty simple & more often than not publicly available (see http://www.asfusion.com/blog/examples/ for instance).
  • Felix Dumb's Gravatar
    Posted By
    Felix Dumb | 10/3/07 9:13 PM
    Update: This appears to be on a different port for others. As Jax pointed out you can go: Eclipse, select Help -> Help contents to get there as well :o)

    I was just going into some help files of Aptana when I came across the local address for the Eclipse Help system at: http://127.0.0.1:58041/help/index.jsp

    In there was a wealth of information I just didn't know was on my hard drive ... though I suppose it depends on what plug-in's you've got installed but for me I had:

    references and getting started tips for Subclipse, plus ColdFusion Documentation, Using CF extensions for Flex builder (including details of RDS support), Java development user guide, plug-in guide and loads more. The Aptana section is indepth as well with documentation covering:

    * Ajax Libraries (including Spry 1.5
    * CSS (elements and properties)
    * HTML
    * Javascript (keywords, DOM, core)
    * and even javascript reference for Adobe AIR(though that seems to actually hit Adobe.com livedoc (which is slicker than the CF ones!))