Solved

MENU that gets values from two fields

Posted on 2006-06-22
3
160 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

758 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

24 Experts available now in Live!

Get 1:1 Help Now