Solved

MENU that gets values from two fields

Posted on 2006-06-22
3
161 Views
Last Modified: 2010-04-25
Using dreamweaver MX can I have a menu that gets values from two fields in one table and insert them into two fields in another database?   If so How?

table one:      Fields:    'ID'      and      'businessname'

table two:   Fields:        'userid'    and    'businessname'    
0
Comment
Question by:budgilbert67
  • 2
3 Comments
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 16971282
Hi budgilbert67,

Unless I am misunderstanding your question, you want a form with two pull-downs that write the selection to a third table?

This is pretty easy, but it can be made even easier if you only write the ID and userid to the third table.  There really isn't a reason to also write businessname because you can always pull that value back out by using a select query and joining on the ID or userid column between table 3 and the other one.

You need to create two recordsets for table one and table two.  Create a page with a form and two selects.  Bind the first select to table one's recordset and set ID as the value and businessname as the label, do the same thing for the second select and table two's recordset.

Then create an Insert behavior for the form to table three.  Bind ID and userid to the appropriate columns and you're done.

Let me know if my assumptions here are not correct.
0
 

Author Comment

by:budgilbert67
ID: 16971567
Thank you for you response jason1178
What I need is one menu that gets two field values and then on submit places the values into a new table to two fields

So if I select business name "sample contractor" from the menu, the menu gets both businessname field and the ID field.  Then on submit it places the selected values into a new table to two fields named 'userid' and 'businessname'

I hope I have clearified my question
0
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 500 total points
ID: 16971898
That clarifies it, but I still ask "why?"  If the ID is present in both tables, you can use inner joins in your SQL to pull any item from either table back out.  It's just more efficient design and it avoids you having to one of the following hand-coding options.

Anyway, if it must be the way you describe, you have a couple of options:

1) Javascript.

You can write a little javascript event that fires when you select the businessname from the menu and writes the appropriate ID to a hidden field in the form.

2) Modify the Insert Record behavior

Create the form with one pull down for business name and a blank hidden field for the id.  Use Insert Record to map both fields to the new table.

After using the built-in Insert Record, go into code view and look for the SQL statement block that writes the selection to the database.  Above it, you would need to write some extra code that adds a second variable to the POST string where that variable is the matching ID from the posted business name

3) Get an Extension that creates dependent drop down boxes.

This is probably the easiest solution.  There are extensions out there that will populate a second drop down box depending on what is selected in the first one.  Here's the Google results: http://www.google.com/search?q=dreamweaver+dependent+drop+down

You can either hand code it, search here for other solutions (we've handled this question before) or buy the Interakt extension.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
DreamWeaver publishing with two users 1 231
Refreshing remote files display in Dreamweaver and FileZilla 10 372
Replace Dreamweaver with what? 8 161
Barcode detail gets lost in PDF 3 104
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…
I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
A short film showing how OnPage and Connectwise integration works.

929 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

11 Experts available now in Live!

Get 1:1 Help Now