[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

dependant/multiple selection query in DW

Posted on 2004-11-30
5
Medium Priority
?
215 Views
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.

regards,
h'eddie

0
Comment
Question by:heddie
3 Comments
 
LVL 10

Expert Comment

by:rockmansattic
ID: 12708977
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

0
 
LVL 1

Accepted Solution

by:
snaef earned 800 total points
ID: 12719594
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
0
 

Author Comment

by:heddie
ID: 12765192
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





0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
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…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…

865 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