• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Problem with form display and linking fields.

Guest
Oct 25, 2009 Oct 25, 2009

Copy link to clipboard

Copied

I have two tables in my database (orders & product orders). Orders would have one record that could have many corresponding records in ProductOrders. The problem is two-fold.

1) How do I present the ProductOrders page which consists of 4 drop down menus and 1 text field in a row so that users enter only as many orders as they need to. I dont want to display 20 rows of drop down menus only to have the user input only one order. Ideally I would like to have a way where the product orders page presents the first row and then once filled in would present another row, etc. Is this possible or is there a better way?

2) How do I link the Orders.ID to the ProductOrders.OrderID on my submission form? I thought I would display the two pages together using a cfinclude but am unclear how the ID's will be linked. They should all be the same number ie: Orders.ID = 24 then all productorders.OrderID would be 24 too.

I hope I'm making sense! Thanks in advance!!

TOPICS
Getting started

Views

582

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 26, 2009 Oct 26, 2009

Copy link to clipboard

Copied

You may need to provide some codes

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 01, 2009 Nov 01, 2009

Copy link to clipboard

Copied

LATEST

I agree with you. Twenty dropdown lists on a single page is too much.

To go by your description, I would create distinct product pages, say, productPage001.cfm,  productPage002.cfm,  productPage003.cfm, and so on. Then I would put 4 dropdown lists per form per page, and use a table -- even, better, use div and CSS -- to display them in a row.

You could pass the orderID from form/page to form/page as a hidden form-field or as a session variable. Include links (and appropriate Javascript for form submission) on each form/page to proceed to the next, or to the previous, page. Alternatively, use submit buttons.

This also immediately suggests you could apply cfform's preservedata attribute to preserve the selected values in the form fields. You could also use session variables or a database to store the selected values.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation