dependant/multiple selection query in DW

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.

regards,
h'eddie

heddieAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rockmansatticCommented:
well,
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
Rockman

snaefCommented:
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";

objXml.open("GET", datafile, true);
objXml.onreadystatechange=function() {
   if (objXml.readyState==4) {
            display(objXml.responseText);
  }
 }

objXml.send(null);

function display(msg) {
  alert(msg);
  //....do 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:
http://www.rgagnon.com/jsdetails/js-0034.html

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

-Scott

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
heddieAuthor Commented:
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.  

rdgs,
e





It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Dreamweaver

From novice to tech pro — start learning today.