?
Solved

MENU that gets values from two fields

Posted on 2006-06-22
3
Medium Priority
?
167 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

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…
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…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

719 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