Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

MENU that gets values from two fields

Posted on 2006-06-22
3
Medium Priority
?
169 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 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

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…
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…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month11 days, 8 hours left to enroll

916 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