dependant/multiple selection query in DW

Posted on 2004-11-30
Last Modified: 2010-04-25
hi all,

I would like to use Dreamweaver to do the following (if possible).  I can create a dg/ds to display all the fields and records I want but would like to know how to create the search (submit ) based on a access table populating a dropdown list.

So Basically...

level 1.... would get  it's  value from a table ( ideally, multiple selections would be really really nice)

level 2.... would get it's dropdown list based on level 1's selection ( ideally,if possible, it would be all dependants from Level 1)

to put it into txt.. if a user selects Toyotas and GM ( and it would be an "and" ) in level 1.  Level 2 would get it's dropdown for all the models.. ( say Camry, Corolla, Cadillac, Firefly, etc) and on the submit button, would show the inventory for all the models seleted (multiple would be nice).

Might be a lot to ask on this forum so if there is some recommended tutorial to follow or helpfull readings....that'll be much appreciated.


Question by:heddie
    LVL 10

    Expert Comment

    as far as tuts, someone may know of some, but I do not.

    But, the dropdown lists are not that hard with DW, actually their easy BUT only for single selections.
    Ill see if I can get you started.
    create a form with the two dropdown boxes
    connect the your database
    select a query to run the first dropdownbox
    click the dropdown box to view its properties
    click dynamic...
    choose the proper recordset for 'Options from recordset'
    create a submit button
    have the form submit to the same page i.e.  this_page.php
    have the form method GET
    now create a query for the SECOND dropdownbox
    have it query for the GET variable: in asp is would be request.querystring("thisformfieldname") and in php it is $_GET['thisformfieldname']

    This should get you started.
    As for having multiple selections possible, you will have to hand code several lines of code to perform repeat actions based on the selected items.  I suggest getting a good understanding of what is going on before attempting this.  MAKE SURE YOU look at the code and understand what is going on. DW is easy, but it is also no perfect.

    Good luck

    LVL 1

    Accepted Solution

    You could accomplish this with JavaScript.  Although not a pure DW solution, you can have a Javascript function request the data for the second dd when an onChange event is fired on the first dd.   Even though the JavaScript does not have a method of "getting" text from the web server the XML Dom does specify a way to grab data from the server.

    Here is an example of how to do this in IE

    objXml = new ActiveXObject("Microsoft.XMLHTTP");

    // objXml = new ActiveXObject("Msxml2.XMLHTTP"); older version
    var datafile = "data.asp?searchval=myvalue";"GET", datafile, true);
    objXml.onreadystatechange=function() {
       if (objXml.readyState==4) {


    function display(msg) {
      // more stuff to populate the drop down box.


    The key to making this work is the line: var datafile = "data.asp?searchval=myvalue";

    You can pass the searchval to an asp page you create that will return the result in either xml if you want ot get fancy or just a simple text string such as: "result1, result2, result3".  Just make sure your data.asp page does not send back any other formatting tages etc....just the text string.

    You can then process the result sent back to populate your second dd list.

    More examples of how to grab text from the server at runtime for other browser versions are available at:

    IMHO this is a more elegant solution as the user does not have to see the whole page refresh/reload.


    Author Comment

    scott ( sorry for the delay)

    I've looked around and there doesn't seem to be a pure DW solution.  so is your suggestion to have a single dropdown list which will query my access db and then have results populate another dropdown query which the user can (re)query the results from the first selection.. sort of like a dependant dropdown base on the first selection ?

    I'll look over your suggested site but a little about myself.  I'm not a programmer but I like to dilly dally a bit with web applications.  



    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Suggested Solutions

    Title # Comments Views Activity
    Simple PHP Upload Script 11 2,650
    Dreamweaver CS5.5 Error 5 529
    Debug PHP with Dreamweaver 6 505
    JQuery form validation for bootstrap 1 170
    Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
    This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now