Solved

MENU that gets values from two fields

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
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 …
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

635 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